From 3488fc0aa08194d830078529a80d3a7eefc186c3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 26 Sep 2024 00:23:23 +0000 Subject: [PATCH 1/2] fix!: The type of an existing field `time_zone` is changed from `message` to `string` in message `.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest` fix!: An existing field `account_aggregation` is removed from message `.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest` fix!: Changed field behavior for an existing field `service` in message `.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest` fix!: Changed field behavior for an existing field `region_code` in message `.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest` fix!: Changed field behavior for an existing field `kind` in message `.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest` feat: A new field `account_aggregation` is added to message `.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest` feat: A new message `AccountAggregation` is added feat: A new service `AutofeedSettingsService` is added feat: A new message `AutofeedSettings` is added feat: A new resource_definition `merchantapi.googleapis.com/AutofeedSettings` is added feat: A new message `GetAutofeedSettingsRequest` is added feat: A new message `UpdateAutofeedSettingsRequest` is added feat: A new field `korean_business_registration_number` is added to message `.google.shopping.merchant.accounts.v1beta.BusinessInfo` PiperOrigin-RevId: 678841094 Source-Link: https://github.com/googleapis/googleapis/commit/005df4681b89bd204a90b76168a6dc9d9e7bf4fe Source-Link: https://github.com/googleapis/googleapis-gen/commit/1c58da100531d09e9123331d121f410e7d00e4aa Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLW1lcmNoYW50LWFjY291bnRzLy5Pd2xCb3QueWFtbCIsImgiOiIxYzU4ZGExMDA1MzFkMDllOTEyMzMzMWQxMjFmNDEwZTdkMDBlNGFhIn0= --- .../v1beta/.eslintignore | 7 + .../v1beta/.eslintrc.json | 3 + .../v1beta/.gitignore | 14 + .../v1beta/.jsdoc.js | 55 + .../v1beta/.mocharc.js | 33 + .../v1beta/.prettierrc.js | 22 + .../v1beta/README.md | 1 + .../v1beta/package.json | 72 + .../accounts/v1beta/accessright.proto | 37 + .../accounts/v1beta/account_tax.proto | 143 + .../accounts/v1beta/accountissue.proto | 155 + .../merchant/accounts/v1beta/accounts.proto | 304 + .../accounts/v1beta/accountservices.proto | 30 + .../accounts/v1beta/autofeedsettings.proto | 106 + .../accounts/v1beta/businessidentity.proto | 160 + .../accounts/v1beta/businessinfo.proto | 114 + .../accounts/v1beta/customerservice.proto | 38 + .../accounts/v1beta/emailpreferences.proto | 128 + .../merchant/accounts/v1beta/homepage.proto | 147 + .../v1beta/online_return_policy.proto | 264 + .../v1beta/phoneverificationstate.proto | 34 + .../merchant/accounts/v1beta/programs.proto | 220 + .../merchant/accounts/v1beta/regions.proto | 254 + .../accounts/v1beta/shippingsettings.proto | 719 + .../merchant/accounts/v1beta/tax_rule.proto | 87 + .../accounts/v1beta/termsofservice.proto | 145 + .../v1beta/termsofserviceagreementstate.proto | 169 + .../accounts/v1beta/termsofservicekind.proto | 31 + .../merchant/accounts/v1beta/user.proto | 217 + .../protos/google/shopping/type/types.proto | 193 + .../v1beta/protos/protos.d.ts | 22846 ++++++ .../v1beta/protos/protos.js | 57252 ++++++++++++++++ .../v1beta/protos/protos.json | 6551 ++ ...count_issue_service.list_account_issues.js | 90 + .../account_tax_service.get_account_tax.js | 61 + .../account_tax_service.list_account_tax.js | 73 + .../account_tax_service.update_account_tax.js | 65 + ...ts_service.create_and_configure_account.js | 80 + .../v1beta/accounts_service.delete_account.js | 62 + .../v1beta/accounts_service.get_account.js | 62 + .../v1beta/accounts_service.list_accounts.js | 78 + .../accounts_service.list_sub_accounts.js | 77 + .../v1beta/accounts_service.update_account.js | 66 + ..._settings_service.get_autofeed_settings.js | 62 + ...ttings_service.update_autofeed_settings.js | 66 + ..._identity_service.get_business_identity.js | 62 + ...entity_service.update_business_identity.js | 66 + ...business_info_service.get_business_info.js | 62 + ...iness_info_service.update_business_info.js | 66 + ...eferences_service.get_email_preferences.js | 62 + ...rences_service.update_email_preferences.js | 66 + .../v1beta/homepage_service.claim_homepage.js | 62 + .../v1beta/homepage_service.get_homepage.js | 62 + .../homepage_service.unclaim_homepage.js | 62 + .../homepage_service.update_homepage.js | 66 + ...policy_service.get_online_return_policy.js | 62 + ...icy_service.list_online_return_policies.js | 82 + .../programs_service.disable_program.js | 62 + .../v1beta/programs_service.enable_program.js | 62 + .../v1beta/programs_service.get_program.js | 62 + .../v1beta/programs_service.list_programs.js | 75 + .../v1beta/regions_service.create_region.js | 73 + .../v1beta/regions_service.delete_region.js | 62 + .../v1beta/regions_service.get_region.js | 62 + .../v1beta/regions_service.list_regions.js | 78 + .../v1beta/regions_service.update_region.js | 67 + ..._settings_service.get_shipping_settings.js | 62 + ...ttings_service.insert_shipping_settings.js | 67 + ...gle.shopping.merchant.accounts.v1beta.json | 1967 + ...ce.get_terms_of_service_agreement_state.js | 63 + ...cation_terms_of_service_agreement_state.js | 62 + ...service_service.accept_terms_of_service.js | 74 + ...of_service_service.get_terms_of_service.js | 62 + ...ervice.retrieve_latest_terms_of_service.js | 68 + .../v1beta/user_service.create_user.js | 73 + .../v1beta/user_service.delete_user.js | 64 + .../generated/v1beta/user_service.get_user.js | 65 + .../v1beta/user_service.list_users.js | 77 + .../v1beta/user_service.update_user.js | 68 + .../v1beta/src/index.ts | 53 + .../v1beta/account_issue_service_client.ts | 1065 + .../account_issue_service_client_config.json | 43 + .../account_issue_service_proto_list.json | 24 + .../src/v1beta/account_tax_service_client.ts | 1172 + .../account_tax_service_client_config.json | 53 + .../account_tax_service_proto_list.json | 24 + .../src/v1beta/accounts_service_client.ts | 1527 + .../accounts_service_client_config.json | 68 + .../v1beta/accounts_service_proto_list.json | 24 + .../autofeed_settings_service_client.ts | 982 + ...tofeed_settings_service_client_config.json | 48 + .../autofeed_settings_service_proto_list.json | 24 + .../business_identity_service_client.ts | 983 + ...siness_identity_service_client_config.json | 48 + .../business_identity_service_proto_list.json | 24 + .../v1beta/business_info_service_client.ts | 982 + .../business_info_service_client_config.json | 48 + .../business_info_service_proto_list.json | 24 + .../email_preferences_service_client.ts | 997 + ...ail_preferences_service_client_config.json | 48 + .../email_preferences_service_proto_list.json | 24 + .../v1beta/src/v1beta/gapic_metadata.json | 701 + .../src/v1beta/homepage_service_client.ts | 1136 + .../homepage_service_client_config.json | 58 + .../v1beta/homepage_service_proto_list.json | 24 + .../v1beta/src/v1beta/index.ts | 33 + .../online_return_policy_service_client.ts | 1128 + ...e_return_policy_service_client_config.json | 48 + ...line_return_policy_service_proto_list.json | 24 + .../src/v1beta/programs_service_client.ts | 1254 + .../programs_service_client_config.json | 58 + .../v1beta/programs_service_proto_list.json | 24 + .../src/v1beta/regions_service_client.ts | 1340 + .../v1beta/regions_service_client_config.json | 63 + .../v1beta/regions_service_proto_list.json | 24 + .../shipping_settings_service_client.ts | 984 + ...ipping_settings_service_client_config.json | 34 + .../shipping_settings_service_proto_list.json | 24 + ..._service_agreement_state_service_client.ts | 981 + ...agreement_state_service_client_config.json | 48 + ...ce_agreement_state_service_proto_list.json | 24 + .../v1beta/terms_of_service_service_client.ts | 1056 + ...erms_of_service_service_client_config.json | 53 + .../terms_of_service_service_proto_list.json | 24 + .../v1beta/src/v1beta/user_service_client.ts | 1341 + .../v1beta/user_service_client_config.json | 63 + .../src/v1beta/user_service_proto_list.json | 24 + .../system-test/fixtures/sample/src/index.js | 41 + .../system-test/fixtures/sample/src/index.ts | 116 + .../v1beta/system-test/install.ts | 49 + .../gapic_account_issue_service_v1beta.ts | 1023 + .../test/gapic_account_tax_service_v1beta.ts | 1243 + .../test/gapic_accounts_service_v1beta.ts | 1601 + .../gapic_autofeed_settings_service_v1beta.ts | 951 + .../gapic_business_identity_service_v1beta.ts | 951 + .../gapic_business_info_service_v1beta.ts | 951 + .../gapic_email_preferences_service_v1beta.ts | 951 + .../test/gapic_homepage_service_v1beta.ts | 1167 + ...pic_online_return_policy_service_v1beta.ts | 1131 + .../test/gapic_programs_service_v1beta.ts | 1347 + .../test/gapic_regions_service_v1beta.ts | 1459 + .../gapic_shipping_settings_service_v1beta.ts | 947 + ..._service_agreement_state_service_v1beta.ts | 947 + .../gapic_terms_of_service_service_v1beta.ts | 1022 + .../v1beta/test/gapic_user_service_v1beta.ts | 1459 + .../v1beta/tsconfig.json | 19 + .../v1beta/webpack.config.js | 64 + 147 files changed, 131843 insertions(+) create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintignore create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintrc.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.gitignore create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.jsdoc.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.mocharc.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.prettierrc.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/README.md create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/package.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accessright.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/account_tax.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accounts.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/customerservice.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/emailpreferences.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/homepage.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/online_return_policy.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/programs.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/regions.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/tax_rule.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservicekind.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/user.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/type/types.proto create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.d.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_issue_service.list_account_issues.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.get_account_tax.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.list_account_tax.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.update_account_tax.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.create_and_configure_account.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.delete_account.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.get_account.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_accounts.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_sub_accounts.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.update_account.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.get_business_identity.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.update_business_identity.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.get_business_info.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.update_business_info.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.get_email_preferences.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.update_email_preferences.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.claim_homepage.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.get_homepage.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.unclaim_homepage.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.update_homepage.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.get_online_return_policy.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.disable_program.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.enable_program.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.get_program.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.list_programs.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.create_region.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.delete_region.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.get_region.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.list_regions.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.update_region.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.get_shipping_settings.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.insert_shipping_settings.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.get_terms_of_service.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.create_user.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.delete_user.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.get_user.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.list_users.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.update_user.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/index.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/index.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client_config.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_proto_list.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/install.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_issue_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_tax_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_accounts_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_autofeed_settings_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_identity_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_info_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_email_preferences_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_homepage_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_online_return_policy_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_programs_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_regions_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_shipping_settings_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_agreement_state_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_user_service_v1beta.ts create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/tsconfig.json create mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/webpack.config.js diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintignore b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintrc.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.gitignore b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.jsdoc.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.jsdoc.js new file mode 100644 index 00000000000..4be7d1c0e84 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.jsdoc.js @@ -0,0 +1,55 @@ +// 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'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-shopping/accounts', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.mocharc.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.mocharc.js @@ -0,0 +1,33 @@ +// 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. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.prettierrc.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.prettierrc.js @@ -0,0 +1,22 @@ +// 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/README.md b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/README.md new file mode 100644 index 00000000000..ff398a3c4cf --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/README.md @@ -0,0 +1 @@ +Accounts: Nodejs Client diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/package.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/package.json new file mode 100644 index 00000000000..97fd6d0ebf7 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/package.json @@ -0,0 +1,72 @@ +{ + "name": "@google-shopping/accounts", + "version": "0.1.0", + "description": "Accounts client for Node.js", + "repository": "googleapis/nodejs-accounts", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google accounts", + "accounts", + "account issue service", + "accounts service", + "account tax service", + "autofeed settings service", + "business identity service", + "business info service", + "email preferences service", + "homepage service", + "online return policy service", + "programs service", + "regions service", + "shipping settings service", + "terms of service agreement state service", + "terms of service service", + "user service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accessright.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accessright.proto new file mode 100644 index 00000000000..40d972f5cc2 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accessright.proto @@ -0,0 +1,37 @@ +// 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; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "AccessRightProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// The access right. +enum AccessRight { + // Default value. This value is unused. + ACCESS_RIGHT_UNSPECIFIED = 0; + + // Standard access rights. + STANDARD = 1; + + // Admin access rights. + ADMIN = 2; + + // Users with this right have access to performance and insights. + PERFORMANCE_REPORTING = 3; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/account_tax.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/account_tax.proto new file mode 100644 index 00000000000..440ddcba346 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/account_tax.proto @@ -0,0 +1,143 @@ +// 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"; +import "google/shopping/merchant/accounts/v1beta/tax_rule.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "AccountTaxProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Manages account level tax setting data. +// +// This API defines the following resource model: +// +// - [AccountTax][google.shopping.merchant.accounts.v1main.AccountTax] +service AccountTaxService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Returns the tax rules that match the conditions of GetAccountTaxRequest + rpc GetAccountTax(GetAccountTaxRequest) returns (AccountTax) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/accounttax/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists the tax settings of the sub-accounts only in your + // Merchant Center account. + // This method can only be called on a multi-client account, otherwise it'll + // return an error. + rpc ListAccountTax(ListAccountTaxRequest) returns (ListAccountTaxResponse) { + option (google.api.http) = { + get: "/accounts/v1beta/{parent=accounts/*}/accounttax" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the tax settings of the account. + rpc UpdateAccountTax(UpdateAccountTaxRequest) returns (AccountTax) { + option (google.api.http) = { + patch: "/accounts/v1beta/{account_tax.name=accounts/*/accounttax/*}" + body: "account_tax" + }; + option (google.api.method_signature) = "account_tax,update_mask"; + option (google.api.method_signature) = "account_tax"; + } +} + +// The tax settings of a merchant account. All methods require the admin role. +message AccountTax { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/AccountTax" + pattern: "accounts/{account}/accounttax/{tax}" + plural: "accountTaxes" + singular: "accountTax" + }; + + // Identifier. The name of the tax setting. + // Format: + // "{account_tax.name=accounts/{account}}" + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The ID of the account to which these account tax settings + // belong. + int64 account = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Tax rules. "Define the tax rules in each region. + // No tax will be presented if a region has no rule." + repeated TaxRule tax_rules = 3; +} + +// Request to get tax settings +message GetAccountTaxRequest { + // Required. The name from which tax settings will be retrieved + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/AccountTax" + } + ]; +} + +// Request to update the tax settings +message UpdateAccountTaxRequest { + // Required. The tax setting that will be updated + AccountTax account_tax = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated + google.protobuf.FieldMask update_mask = 2; +} + +// Request to list all sub-account tax settings only for the requesting merchant +// This method can only be called on a multi-client account, otherwise it'll +// return an error. +message ListAccountTaxRequest { + // Required. The parent, which owns this collection of account tax. + // Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/AccountTax" + } + ]; + + // The maximum number of tax settings to return in the response, used for + // paging. + int32 page_size = 2; + + // The token returned by the previous request. + string page_token = 3; +} + +// Response to account tax list request +// This method can only be called on a multi-client account, otherwise it'll +// return an error. +message ListAccountTaxResponse { + // Page of accounttax settings + repeated AccountTax account_taxes = 1; + + // The token for the retrieval of the next page of account tax settings. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto new file mode 100644 index 00000000000..8651baa5a2a --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto @@ -0,0 +1,155 @@ +// 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/shopping/type/types.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "AccountIssueProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support `AccountIssueService` API. +service AccountIssueService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Lists all account issues of a Merchant Center account. + rpc ListAccountIssues(ListAccountIssuesRequest) + returns (ListAccountIssuesResponse) { + option (google.api.http) = { + get: "/accounts/v1beta/{parent=accounts/*}/issues" + }; + option (google.api.method_signature) = "parent"; + } +} + +// An +// [`AccountIssue`](https://support.google.com/merchants/answer/12153802?sjid=17798438912526418908-EU#account). +message AccountIssue { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/AccountIssue" + pattern: "accounts/{account}/issues/{issue}" + plural: "accountIssues" + singular: "accountIssue" + }; + + // The impact of the issue on a destination. + message ImpactedDestination { + // The impact of the issue on a region. + message Impact { + // The [CLDR region code](https://cldr.unicode.org/) where this issue + // applies. + string region_code = 1; + + // The severity of the issue on the destination and region. + Severity severity = 2; + } + + // The impacted reporting context. + optional google.shopping.type.ReportingContext.ReportingContextEnum + reporting_context = 1; + + // The (negative) impact for various regions on the given destination. + repeated Impact impacts = 2; + } + + // All possible issue severities. + enum Severity { + // The severity is unknown. + SEVERITY_UNSPECIFIED = 0; + + // The issue causes offers to not serve. + CRITICAL = 1; + + // The issue might affect offers (in the future) or might be an + // indicator of issues with offers. + ERROR = 2; + + // The issue is a suggestion for improvement. + SUGGESTION = 3; + } + + // Identifier. The resource name of the account issue. + // Format: `accounts/{account}/issues/{id}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The localized title of the issue. + string title = 2; + + // The overall severity of the issue. + Severity severity = 3; + + // The impact this issue has on various destinations. + repeated ImpactedDestination impacted_destinations = 4; + + // Further localized details about the issue. + string detail = 5; + + // Link to Merchant Center Help Center providing further information about the + // issue and how to fix it. + string documentation_uri = 6; +} + +// Request message for the `ListAccountIssues` method. +message ListAccountIssuesRequest { + // Required. The parent, which owns this collection of issues. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; + + // Optional. The maximum number of issues to return. The service may return + // fewer than this value. If unspecified, at most 50 users will be returned. + // The maximum value is 100; values above 100 will be coerced to 100 + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListAccountIssues` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAccountIssues` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The issues in the response will have human-readable fields in the + // 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. + string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ListAccountIssues` method. +message ListAccountIssuesResponse { + // The issues from the specified account. + repeated AccountIssue account_issues = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accounts.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accounts.proto new file mode 100644 index 00000000000..63a51cc07d4 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accounts.proto @@ -0,0 +1,304 @@ +// 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/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"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "AccountsProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support Accounts API. +service AccountsService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves an account from your Merchant Center account. + // After inserting, updating, or deleting an account, it may take several + // minutes before changes take effect. + rpc GetAccount(GetAccountRequest) returns (Account) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a standalone Merchant Center account with additional configuration. + // Adds the user that makes the request as an admin for the new account. + rpc CreateAndConfigureAccount(CreateAndConfigureAccountRequest) + returns (Account) { + option (google.api.http) = { + post: "/accounts/v1beta/accounts:createAndConfigure" + body: "*" + }; + } + + // Deletes the specified account regardless of its type: standalone, MCA or + // sub-account. Deleting an MCA leads to the deletion of all of its + // sub-accounts. Executing this method requires admin access. + rpc DeleteAccount(DeleteAccountRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/accounts/v1beta/{name=accounts/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an account regardless of its type: standalone, MCA or sub-account. + // Executing this method requires admin access. + rpc UpdateAccount(UpdateAccountRequest) returns (Account) { + option (google.api.http) = { + patch: "/accounts/v1beta/{account.name=accounts/*}" + body: "account" + }; + option (google.api.method_signature) = "account,update_mask"; + } + + // Lists accounts accessible to the calling user and matching the + // constraints of the request such as page size or filters. + // This is not just listing the sub-accounts of an MCA, but all accounts the + // calling user has access to including other MCAs, linked accounts, + // standalone accounts and so on. + rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) { + option (google.api.http) = { + get: "/accounts/v1beta/accounts" + }; + } + + // List all sub-accounts for a given multi client account. This is a + // convenience wrapper for the more powerful `ListAccounts` method. This + // method will produce the same results as calling `ListsAccounts` with the + // following filter: + // `relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))` + rpc ListSubAccounts(ListSubAccountsRequest) + returns (ListSubAccountsResponse) { + option (google.api.http) = { + get: "/accounts/v1beta/{provider=accounts/*}:listSubaccounts" + }; + option (google.api.method_signature) = "provider"; + } +} + +// An account. +message Account { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/Account" + pattern: "accounts/{account}" + }; + + // Identifier. The resource name of the account. + // Format: `accounts/{account}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The ID of the account. + int64 account_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. A human-readable name of the account. See + // [store name](https://support.google.com/merchants/answer/160556) and + // [business name](https://support.google.com/merchants/answer/12159159) for + // more information. + string account_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Whether this account contains adult content. + bool adult_content = 4; + + // Output only. Whether this is a test account. + bool test_account = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The time zone of the account. + // + // On writes, `time_zone` sets both the `reporting_time_zone` and the + // `display_time_zone`. + // + // For reads, `time_zone` always returns the `display_time_zone`. If + // `display_time_zone` doesn't exist for your account, `time_zone` is empty. + google.type.TimeZone time_zone = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. The account's [BCP-47 language + // code](https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`. + string language_code = 7 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `GetAccount` method. +message GetAccountRequest { + // Required. The name of the account to retrieve. + // Format: `accounts/{account}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; +} + +// Request message for the `CreateAndConfigureAccount` method. +message CreateAndConfigureAccountRequest { + // Reference to a Terms of Service resource. + message AcceptTermsOfService { + // 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) = { + type: "merchantapi.googleapis.com/TermsOfService" + } + ]; + + // 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 = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Additional instructions to add account services during creation of the + // account. + message AddAccountService { + // The service type to be added. + oneof service_type { + // 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. + // Format: `accounts/{account}` + optional string provider = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; + } + + // Required. The account to be created. + Account account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Users to be added to the account. + repeated CreateUserRequest users = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Terms of Service (ToS) to be accepted immediately upon + // account creation. + optional AcceptTermsOfService accept_terms_of_service = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // 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) = REQUIRED]; +} + +// Request message for the `DeleteAccount` method. +message DeleteAccountRequest { + // Required. The name of the account to delete. + // Format: `accounts/{account}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; +} + +// Request message for the `UpdateAccount` method. +message UpdateAccountRequest { + // Required. The new version of the account. + Account account = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields being updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `ListAccounts` method. +message ListAccountsRequest { + // Optional. The maximum number of accounts to return. The service may return + // fewer than this value. If unspecified, at most 250 accounts are returned. + // The maximum value is 500; values above 500 are coerced to 500. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListAccounts` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAccounts` must match + // the call that provided the page token. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Returns only accounts that match the + // [filter](/merchant/api/guides/accounts/filter). + // For more details, see the + // [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ListAccounts` method. +message ListAccountsResponse { + // The accounts matching the `ListAccountsRequest`. + repeated Account accounts = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for the `ListSubAccounts` method. +message ListSubAccountsRequest { + // Required. The parent account. + // Format: `accounts/{account}` + string provider = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; + + // Optional. The maximum number of accounts to return. The service may return + // fewer than this value. If unspecified, at most 250 accounts are returned. + // The maximum value is 500; values above 500 are coerced to 500. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListAccounts` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListAccounts` must match + // the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ListSubAccounts` method. +message ListSubAccountsResponse { + // The accounts for which the given parent account is an aggregator. + repeated Account accounts = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto new file mode 100644 index 00000000000..daeb15f3a98 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto new file mode 100644 index 00000000000..f6e0c1b3631 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto new file mode 100644 index 00000000000..c7f02c421b3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto @@ -0,0 +1,160 @@ +// 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 = "BusinessIdentityProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support [business +// identity](https://support.google.com/merchants/answer/12564247) API. +service BusinessIdentityService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves the business identity of an account. + rpc GetBusinessIdentity(GetBusinessIdentityRequest) + returns (BusinessIdentity) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/businessIdentity}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the business identity of an account. Executing this method requires + // admin access. + rpc UpdateBusinessIdentity(UpdateBusinessIdentityRequest) + returns (BusinessIdentity) { + option (google.api.http) = { + patch: "/accounts/v1beta/{business_identity.name=accounts/*/businessIdentity}" + body: "business_identity" + }; + option (google.api.method_signature) = "business_identity,update_mask"; + } +} + +// Collection of information related to the [identity of a +// business](https://support.google.com/merchants/answer/12564247). +message BusinessIdentity { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/BusinessIdentity" + pattern: "accounts/{account}/businessIdentity" + plural: "businessIdentities" + singular: "businessIdentity" + }; + + // All information related to an identity attribute. + message IdentityAttribute { + // All possible settings regarding the declaration of an identity. + enum IdentityDeclaration { + // Default value indicating that no selection was made. + IDENTITY_DECLARATION_UNSPECIFIED = 0; + + // Indicates that the account identifies with the attribute. + SELF_IDENTIFIES_AS = 1; + + // Indicates that the account does not identify with the attribute. + DOES_NOT_SELF_IDENTIFY_AS = 2; + } + + // Required. The declaration of identity for this attribute. + IdentityDeclaration identity_declaration = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // All possible settings regarding promotions related to the business + // identity. + enum PromotionsConsent { + // Default value indicating that no selection was made. + PROMOTIONS_CONSENT_UNSPECIFIED = 0; + + // Indicates that the account consented to having their business identity + // used for promotions. + PROMOTIONS_CONSENT_GIVEN = 1; + + // Indicates that the account did not consent to having their business + // identity used for promotions. + PROMOTIONS_CONSENT_DENIED = 2; + } + + // Identifier. The resource name of the business identity. + // Format: `accounts/{account}/businessIdentity` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. Whether the identity attributes may be used for promotions. + PromotionsConsent promotions_consent = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the business identifies itself as being + // black-owned. This optional field will only be available for merchants with + // a business country set to `US`. It is also not applicable for marketplaces + // or marketplace sellers. + IdentityAttribute black_owned = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the business identifies itself as being + // women-owned. This optional field will only be available for merchants with + // a business country set to `US`. It is also not applicable for marketplaces + // or marketplace sellers. + IdentityAttribute women_owned = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the business identifies itself as being + // veteran-owned. This optional field will only be available for merchants + // with a business country set to `US`. It is also not applicable for + // marketplaces or marketplace sellers. + IdentityAttribute veteran_owned = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the business identifies itself as being + // latino-owned. This optional field will only be available for merchants with + // a business country set to `US`. It is also not applicable for marketplaces + // or marketplace sellers. + IdentityAttribute latino_owned = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the business identifies itself as a small + // business. This optional field will only be available for merchants with a + // business country set to `US`. It is also not applicable for marketplaces. + IdentityAttribute small_business = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the `GetBusinessIdentity` method. +message GetBusinessIdentityRequest { + // Required. The resource name of the business identity. + // Format: `accounts/{account}/businessIdentity` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/BusinessIdentity" + } + ]; +} + +// Request message for the `UpdateBusinessIdentity` method. +message UpdateBusinessIdentityRequest { + // Required. The new version of the business identity. + BusinessIdentity business_identity = 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto new file mode 100644 index 00000000000..b040b3d1073 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto @@ -0,0 +1,114 @@ +// 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"; +import "google/shopping/merchant/accounts/v1beta/customerservice.proto"; +import "google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto"; +import "google/type/phone_number.proto"; +import "google/type/postal_address.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "BusinessInfoProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support business info API. +service BusinessInfoService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves the business info of an account. + rpc GetBusinessInfo(GetBusinessInfoRequest) returns (BusinessInfo) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/businessInfo}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the business info of an account. Executing this method requires + // admin access. + rpc UpdateBusinessInfo(UpdateBusinessInfoRequest) returns (BusinessInfo) { + option (google.api.http) = { + patch: "/accounts/v1beta/{business_info.name=accounts/*/businessInfo}" + body: "business_info" + }; + option (google.api.method_signature) = "business_info,update_mask"; + } +} + +// Collection of information related to a business. +message BusinessInfo { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/BusinessInfo" + pattern: "accounts/{account}/businessInfo" + plural: "businessInfos" + singular: "businessInfo" + }; + + // Identifier. The resource name of the business info. + // Format: `accounts/{account}/businessInfo` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The address of the business. + optional google.type.PostalAddress address = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The phone number of the business. + optional google.type.PhoneNumber phone = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The phone verification state of the business. + optional PhoneVerificationState phone_verification_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. +message GetBusinessInfoRequest { + // Required. The resource name of the business info. + // Format: `accounts/{account}/businessInfo` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/BusinessInfo" + } + ]; +} + +// Request message for the `UpdateBusinessInfo` method. +message UpdateBusinessInfoRequest { + // Required. The new version of the business info. + BusinessInfo business_info = 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/customerservice.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/customerservice.proto new file mode 100644 index 00000000000..a9cd9f42c25 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/customerservice.proto @@ -0,0 +1,38 @@ +// 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/field_behavior.proto"; +import "google/type/phone_number.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "CustomerServiceProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Customer service information. +message CustomerService { + // Optional. The URI where customer service may be found. + optional string uri = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The email address where customer service may be reached. + optional string email = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The phone number where customer service may be called. + optional google.type.PhoneNumber phone = 3 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/emailpreferences.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/emailpreferences.proto new file mode 100644 index 00000000000..24bd0ab243d --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/emailpreferences.proto @@ -0,0 +1,128 @@ +// 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 = "EmailPreferencesProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support the `EmailPreferences` API. +// +// This service only permits retrieving and updating email preferences for the +// authenticated user. +service EmailPreferencesService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Returns the email preferences for a Merchant Center account user. + // + // Use the name=accounts/*/users/me/emailPreferences alias to get preferences + // for the authenticated user. + rpc GetEmailPreferences(GetEmailPreferencesRequest) + returns (EmailPreferences) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/users/*/emailPreferences}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the email preferences for a Merchant Center account user. MCA users + // should specify the MCA account rather than a sub-account of the MCA. + // + // Preferences which are not explicitly selected in the update mask will not + // be updated. + // + // It is invalid for updates to specify an UNCONFIRMED opt-in status value. + // + // Use the name=accounts/*/users/me/emailPreferences alias to update + // preferences + // for the authenticated user. + rpc UpdateEmailPreferences(UpdateEmailPreferencesRequest) + returns (EmailPreferences) { + option (google.api.http) = { + patch: "/accounts/v1beta/{email_preferences.name=accounts/*/users/*/emailPreferences}" + body: "email_preferences" + }; + option (google.api.method_signature) = "email_preferences,update_mask"; + } +} + +// The categories of notifications the user opted into / opted out of. The email +// preferences do not include mandatory announcements as users can't opt out of +// them. +message EmailPreferences { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/EmailPreferences" + pattern: "accounts/{account}/users/{email}/emailPreferences" + plural: "emailPreferences" + singular: "emailPreferences" + }; + + // Opt in state of the email preference. + enum OptInState { + // Opt-in status is not specified. + OPT_IN_STATE_UNSPECIFIED = 0; + + // User has opted out of receiving this type of email. + OPTED_OUT = 1; + + // User has opted in to receiving this type of email. + OPTED_IN = 2; + + // User has opted in to receiving this type of email and the confirmation + // email has been sent, but user has not yet confirmed the opt in (applies + // only to certain countries). + UNCONFIRMED = 3; + } + + // Identifier. The name of the EmailPreferences. The endpoint is only + // supported for the authenticated user. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. Updates on new features, tips and best practices. + OptInState news_and_tips = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GetEmailPreferences method. +message GetEmailPreferencesRequest { + // Required. The name of the `EmailPreferences` resource. + // Format: `accounts/{account}/users/{email}/emailPreferences` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/EmailPreferences" + } + ]; +} + +// Request message for UpdateEmailPreferences method. +message UpdateEmailPreferencesRequest { + // Required. Email Preferences to be updated. + EmailPreferences email_preferences = 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/homepage.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/homepage.proto new file mode 100644 index 00000000000..aedfa98cd62 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/homepage.proto @@ -0,0 +1,147 @@ +// 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 = "HomepageProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support an API for a store's homepage. +service HomepageService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves a store's homepage. + rpc GetHomepage(GetHomepageRequest) returns (Homepage) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/homepage}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a store's homepage. Executing this method requires admin access. + rpc UpdateHomepage(UpdateHomepageRequest) returns (Homepage) { + option (google.api.http) = { + patch: "/accounts/v1beta/{homepage.name=accounts/*/homepage}" + body: "homepage" + }; + option (google.api.method_signature) = "homepage,update_mask"; + } + + // Claims a store's homepage. Executing this method requires admin access. + // + // If the homepage is already claimed, this will recheck the + // verification (unless the merchant is exempted from claiming, which also + // exempts from verification) and return a successful response. If ownership + // can no longer be verified, it will return an error, but it won't clear the + // claim. In case of failure, a canonical error message will be returned: + // * PERMISSION_DENIED: user doesn't have the necessary permissions on this + // MC account; + // * FAILED_PRECONDITION: + // - The account is not a Merchant Center account; + // - MC account doesn't have a homepage; + // - claiming failed (in this case the error message will contain more + // details). + rpc ClaimHomepage(ClaimHomepageRequest) returns (Homepage) { + option (google.api.http) = { + post: "/accounts/v1beta/{name=accounts/*/homepage}:claim" + body: "*" + }; + } + + // Unclaims a store's homepage. Executing this method requires admin access. + rpc UnclaimHomepage(UnclaimHomepageRequest) returns (Homepage) { + option (google.api.http) = { + post: "/accounts/v1beta/{name=accounts/*/homepage}:unclaim" + body: "*" + }; + } +} + +// A store's homepage. +message Homepage { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/Homepage" + pattern: "accounts/{account}/homepage" + plural: "homepages" + singular: "homepage" + }; + + // Identifier. The resource name of the store's homepage. + // Format: `accounts/{account}/homepage` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The URI (typically a URL) of the store's homepage. + optional string uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Whether the homepage is claimed. See + // https://support.google.com/merchants/answer/176793. + bool claimed = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the `GetHomepage` method. +message GetHomepageRequest { + // Required. The name of the homepage to retrieve. + // Format: `accounts/{account}/homepage` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Homepage" + } + ]; +} + +// Request message for the `UpdateHomepage` method. +message UpdateHomepageRequest { + // Required. The new version of the homepage. + Homepage homepage = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields being updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `ClaimHomepage` method. +message ClaimHomepageRequest { + // Required. The name of the homepage to claim. + // Format: `accounts/{account}/homepage` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Homepage" + } + ]; +} + +// Request message for the `UnclaimHomepage` method. +message UnclaimHomepageRequest { + // Required. The name of the homepage to unclaim. + // Format: `accounts/{account}/homepage` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Homepage" + } + ]; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/online_return_policy.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/online_return_policy.proto new file mode 100644 index 00000000000..52c7168b905 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/online_return_policy.proto @@ -0,0 +1,264 @@ +// 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/shopping/type/types.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "OnlineReturnPolicyProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// The service facilitates the management of a merchant's remorse return policy +// configuration, encompassing return policies for both ads and free listings +// ## programs. This API defines the following resource model: +// +// [OnlineReturnPolicy][google.shopping.merchant.accounts.v1.OnlineReturnPolicy] +service OnlineReturnPolicyService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Gets an existing return policy. + rpc GetOnlineReturnPolicy(GetOnlineReturnPolicyRequest) + returns (OnlineReturnPolicy) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/onlineReturnPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all existing return policies. + rpc ListOnlineReturnPolicies(ListOnlineReturnPoliciesRequest) + returns (ListOnlineReturnPoliciesResponse) { + option (google.api.http) = { + get: "/accounts/v1beta/{parent=accounts/*}/onlineReturnPolicies" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for the `GetOnlineReturnPolicy` method. +message GetOnlineReturnPolicyRequest { + // Required. The name of the return policy to retrieve. + // Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/OnlineReturnPolicy" + } + ]; +} + +// Request message for the `ListOnlineReturnPolicies` method. +message ListOnlineReturnPoliciesRequest { + // Required. The merchant account for which to list return policies. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/OnlineReturnPolicy" + } + ]; + + // Optional. The maximum number of `OnlineReturnPolicy` resources to return. + // The service returns fewer than this value if the number of return policies + // for the given merchant is less that than the `pageSize`. The default value + // is 10. The maximum value is 100; If a value higher than the maximum is + // specified, then the `pageSize` will default to the maximum + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListOnlineReturnPolicies` + // call. Provide the page token to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListOnlineReturnPolicies` must match the call that provided the page + // token. The token returned as + // [nextPageToken][google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token] + // in the response to the previous request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ListOnlineReturnPolicies` method. +message ListOnlineReturnPoliciesResponse { + // The retrieved return policies. + repeated OnlineReturnPolicy online_return_policies = 1; + + // A token, which can be sent as `pageToken` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// [Online return policy](https://support.google.com/merchants/answer/10220642) +// object. This is currently used to represent return policies for ads and free +// listings programs. +message OnlineReturnPolicy { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/OnlineReturnPolicy" + pattern: "accounts/{account}/onlineReturnPolicies/{return_policy}" + plural: "onlineReturnPolicies" + singular: "onlineReturnPolicy" + }; + + // The return shipping fee. This can either be a fixed fee or a boolean to + // indicate that the customer pays the actual shipping cost. + message ReturnShippingFee { + // Return shipping fee types. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // The return shipping fee is a fixed value. + FIXED = 1; + + // Customers will pay the actual return shipping fee. + CUSTOMER_PAYING_ACTUAL_FEE = 2; + } + + // Type of return shipping fee. + Type type = 1; + + // Fixed return shipping fee amount. This value is only applicable when type + // is `FIXED`. We will treat the return shipping fee as free if type is + // `FIXED` and this value is not set. + google.shopping.type.Price fixed_fee = 2; + } + + // The restocking fee. This can be a flat fee or a micro percent. + message RestockingFee { + oneof type { + // Fixed restocking fee. + google.shopping.type.Price fixed_fee = 1; + + // Percent of total price in micros. 15,000,000 means 15% of the total + // price would be charged. + int32 micro_percent = 2; + } + } + + // The available policies. + message Policy { + // Return policy types. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // The number of days within which a return is valid after delivery. + NUMBER_OF_DAYS_AFTER_DELIVERY = 1; + + // No returns. + NO_RETURNS = 2; + + // Life time returns. + LIFETIME_RETURNS = 3; + } + + // Policy type. + Type type = 1; + + // The number of days items can be returned after delivery, where one day + // is defined as 24 hours after the delivery timestamp. Required for + // `NUMBER_OF_DAYS_AFTER_DELIVERY` returns. + int64 days = 2; + } + + // The available return methods. + enum ReturnMethod { + // Default value. This value is unused. + RETURN_METHOD_UNSPECIFIED = 0; + + // Return by mail. + BY_MAIL = 1; + + // Return in store. + IN_STORE = 2; + + // Return at a kiosk. + AT_A_KIOSK = 3; + } + + // The available item conditions. + enum ItemCondition { + // Default value. This value is unused. + ITEM_CONDITION_UNSPECIFIED = 0; + + // New. + NEW = 1; + + // Used. + USED = 2; + } + + // Identifier. The name of the `OnlineReturnPolicy` resource. + // Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Return policy ID generated by Google. + string return_policy_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // This field represents the unique user-defined label of the return policy. + // It is important to note that the same label cannot be used in different + // return policies for the same country. Unless a product specifies a specific + // label attribute, policies will be automatically labeled as 'default'. + // To assign a custom return policy to certain product groups, follow the + // instructions provided in the [Return policy label] + // (https://support.google.com/merchants/answer/9445425). + // The label can contain up to 50 characters. + string label = 3; + + // The countries of sale where the return policy applies. The values + // must be a valid 2 letter ISO 3166 code. + repeated string countries = 4; + + // The return policy. + Policy policy = 5; + + // The restocking fee that applies to all return reason categories. This would + // be treated as a free restocking fee if the value is not set. + RestockingFee restocking_fee = 6; + + // The return methods of how customers can return an item. This value is + // required to not be empty unless the type of return policy is noReturns. + repeated ReturnMethod return_methods = 7; + + // The item conditions accepted for returns must not be empty unless the type + // of return policy is 'noReturns'. + repeated ItemCondition item_conditions = 8; + + // The return shipping fee. Should be set only when customer need to download + // and print the return label. + ReturnShippingFee return_shipping_fee = 9; + + // The return policy uri. This can used by Google to do a sanity check for the + // policy. It must be a valid URL. + string return_policy_uri = 10; + + // This field specifies if merchant only accepts defective products for + // returns, and this field is required. + optional bool accept_defective_only = 11; + + // The field specifies the number of days it takes for merchants to process + // refunds, field is optional. + optional int32 process_refund_days = 12; + + // This field specifies if merchant allows customers to exchange products, + // this field is required. + optional bool accept_exchange = 13; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto new file mode 100644 index 00000000000..1a55d08ef9e --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto @@ -0,0 +1,34 @@ +// 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; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "PhoneVerificationStateProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// The phone verification state. +enum PhoneVerificationState { + // Default value. This value is unused. + PHONE_VERIFICATION_STATE_UNSPECIFIED = 0; + + // The phone is verified. + PHONE_VERIFICATION_STATE_VERIFIED = 1; + + // The phone is unverified + PHONE_VERIFICATION_STATE_UNVERIFIED = 2; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/programs.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/programs.proto new file mode 100644 index 00000000000..e0f5dcd8782 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/programs.proto @@ -0,0 +1,220 @@ +// 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 = "ProgramsProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service for program management. +// +// Programs provide a mechanism for adding functionality to merchant accounts. A +// typical example of this is the [Free product +// listings](https://support.google.com/merchants/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) +// program, which enables products from a merchant's store to be shown across +// Google for free. +// +// This service exposes methods to retrieve a merchant's +// participation in all available programs, in addition to methods for +// explicitly enabling or disabling participation in each program. +service ProgramsService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves the specified program for the account. + rpc GetProgram(GetProgramRequest) returns (Program) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/programs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves all programs for the account. + rpc ListPrograms(ListProgramsRequest) returns (ListProgramsResponse) { + option (google.api.http) = { + get: "/accounts/v1beta/{parent=accounts/*}/programs" + }; + option (google.api.method_signature) = "parent"; + } + + // Enable participation in the specified program for the account. Executing + // this method requires admin access. + rpc EnableProgram(EnableProgramRequest) returns (Program) { + option (google.api.http) = { + post: "/accounts/v1beta/{name=accounts/*/programs/*}:enable" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Disable participation in the specified program for the account. Executing + // this method requires admin access. + rpc DisableProgram(DisableProgramRequest) returns (Program) { + option (google.api.http) = { + post: "/accounts/v1beta/{name=accounts/*/programs/*}:disable" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// Defines participation in a given program for the specified account. +// +// Programs provide a mechanism for adding functionality to merchant accounts. A +// typical example of this is the [Free product +// listings](https://support.google.com/merchants/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) +// program, which enables products from a merchant's store to be shown across +// Google for free. +message Program { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/Program" + pattern: "accounts/{account}/programs/{program}" + plural: "programs" + singular: "program" + }; + + // Defines a requirement specified for participation in the program. + message Requirement { + // Output only. Name of the requirement. + string title = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The URL of a help page describing the requirement. + string documentation_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The regions that are currently affected by this requirement + // not being met. + // + // Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + // either a country where the program applies specifically to that country + // or `001` when the program applies globally. + repeated string affected_region_codes = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Possible program participation states for the account. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The account is not eligible to participate in the program. + NOT_ELIGIBLE = 1; + + // The account is eligible to participate in the program. + ELIGIBLE = 2; + + // The program is enabled for the account. + ENABLED = 3; + } + + // Identifier. The resource name of the program. + // Format: `accounts/{account}/programs/{program}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The URL of a Merchant Center help page describing the program. + string documentation_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The participation state of the account in the program. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The regions in which the account is actively participating in + // the program. Active regions are defined as those where all program + // requirements affecting the regions have been met. + // + // Region codes are defined by [CLDR](https://cldr.unicode.org/). This is + // either a country where the program applies specifically to that country or + // `001` when the program applies globally. + repeated string active_region_codes = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The requirements that the account has not yet satisfied that + // are affecting participation in the program. + repeated Requirement unmet_requirements = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the GetProgram method. +message GetProgramRequest { + // Required. The name of the program to retrieve. + // Format: `accounts/{account}/programs/{program}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Program" + } + ]; +} + +// Request message for the ListPrograms method. +message ListProgramsRequest { + // Required. The name of the account for which to retrieve all programs. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/Program" + } + ]; + + // Optional. The maximum number of programs to return in a single response. If + // unspecified (or 0), a default size of 1000 is used. The maximum value is + // 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A continuation token, received from a previous `ListPrograms` + // call. Provide this to retrieve the next page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the ListPrograms method. +message ListProgramsResponse { + // The programs for the given account. + repeated Program programs = 1; + + // A token that can be sent as `page_token` to retrieve the next page. If this + // field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for the EnableProgram method. +message EnableProgramRequest { + // Required. The name of the program for which to enable participation for the + // given account. Format: `accounts/{account}/programs/{program}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Program" + } + ]; +} + +// Request message for the DisableProgram method. +message DisableProgramRequest { + // Required. The name of the program for which to disable participation for + // the given account. Format: `accounts/{account}/programs/{program}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Program" + } + ]; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/regions.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/regions.proto new file mode 100644 index 00000000000..56a0e5b6453 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/regions.proto @@ -0,0 +1,254 @@ +// 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/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "RegionsProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Manages regions configuration. +// +// This API defines the following resource model: +// +// - [Region][google.shopping.merchant.accounts.v1main.Region] +service RegionsService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves a region defined in your Merchant Center account. + rpc GetRegion(GetRegionRequest) returns (Region) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/regions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a region definition in your Merchant Center account. Executing this + // method requires admin access. + rpc CreateRegion(CreateRegionRequest) returns (Region) { + option (google.api.http) = { + post: "/accounts/v1beta/{parent=accounts/*}/regions" + body: "region" + }; + option (google.api.method_signature) = "parent,region,region_id"; + } + + // Updates a region definition in your Merchant Center account. Executing this + // method requires admin access. + rpc UpdateRegion(UpdateRegionRequest) returns (Region) { + option (google.api.http) = { + patch: "/accounts/v1beta/{region.name=accounts/*/regions/*}" + body: "region" + }; + option (google.api.method_signature) = "region,update_mask"; + } + + // Deletes a region definition from your Merchant Center account. Executing + // this method requires admin access. + rpc DeleteRegion(DeleteRegionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/accounts/v1beta/{name=accounts/*/regions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists the regions in your Merchant Center account. + rpc ListRegions(ListRegionsRequest) returns (ListRegionsResponse) { + option (google.api.http) = { + get: "/accounts/v1beta/{parent=accounts/*}/regions" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for the `GetRegion` method. +message GetRegionRequest { + // Required. The name of the region to retrieve. + // Format: `accounts/{account}/regions/{region}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Region" + } + ]; +} + +// Request message for the `CreateRegion` method. +message CreateRegionRequest { + // Required. The account to create a region for. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; + + // Required. The identifier for the region, unique over all regions of the + // same account. + string region_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The region to create. + Region region = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `UpdateRegion` method. +message UpdateRegionRequest { + // Required. The updated region. + Region region = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The comma-separated field mask indicating the fields to update. + // Example: + // `"displayName,postalCodeArea.regionCode"`. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the `DeleteRegion` method. +message DeleteRegionRequest { + // Required. The name of the region to delete. + // Format: `accounts/{account}/regions/{region}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Region" + } + ]; +} + +// Request message for the `ListRegions` method. +message ListRegionsRequest { + // Required. The account to list regions for. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; + + // Optional. The maximum number of regions to return. The service may return + // fewer than this value. + // If unspecified, at most 50 regions will be returned. + // The maximum value is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListRegions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListRegions` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ListRegions` method. +message ListRegionsResponse { + // The regions from the specified merchant. + repeated Region regions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Represents a geographic region that you can use as a target with both the +// `RegionalInventory` and `ShippingSettings` services. You can define regions +// as collections of either postal codes or, in some countries, using predefined +// geotargets. For more information, see [Set up regions +// ](https://support.google.com/merchants/answer/7410946#zippy=%2Ccreate-a-new-region) +// for more information. +message Region { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/Region" + pattern: "accounts/{account}/regions/{region}" + plural: "regions" + singular: "region" + }; + + // A list of postal codes that defines the region area. + // Note: All regions defined using postal codes are accessible through the + // account's `ShippingSettings.postalCodeGroups` resource. + message PostalCodeArea { + // A range of postal codes that defines the region area. + message PostalCodeRange { + // Required. A postal code or a pattern of the form prefix* denoting the + // inclusive lower bound of the range defining the area. Examples values: + // `94108`, `9410*`, `9*`. + string begin = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A postal code or a pattern of the form `prefix*` denoting the + // inclusive upper bound of the range defining the area. It must have the + // same length as postalCodeRangeBegin: if postalCodeRangeBegin is a + // postal code then postalCodeRangeEnd must be a postal code too; if + // postalCodeRangeBegin is a pattern then postalCodeRangeEnd must be a + // pattern with the same prefix length. Optional: if not set, then the + // area is defined as being all the postal codes matching + // postalCodeRangeBegin. + string end = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. [CLDR territory + // code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + // or the country the postal code group applies to. + string region_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A range of postal codes. + repeated PostalCodeRange postal_codes = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // A list of geotargets that defines the region area. + message GeoTargetArea { + // Required. A non-empty list of [location + // IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + // They must all be of the same location type (for example, state). + repeated int64 geotarget_criteria_ids = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Identifier. The resource name of the region. + // Format: `accounts/{account}/regions/{region}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The display name of the region. + optional string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of postal codes that defines the region area. + PostalCodeArea postal_code_area = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of geotargets that defines the region area. + GeoTargetArea geotarget_area = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Indicates if the region is eligible for use in the Regional + // Inventory configuration. + google.protobuf.BoolValue regional_inventory_eligible = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates if the region is eligible for use in the Shipping + // Services configuration. + google.protobuf.BoolValue shipping_eligible = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto new file mode 100644 index 00000000000..a7fac4a8a24 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto @@ -0,0 +1,719 @@ +// 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/shopping/type/types.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "ShippingSettingsProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to get method call shipping setting information per Merchant API +// method. +service ShippingSettingsService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieve shipping setting information. + rpc GetShippingSettings(GetShippingSettingsRequest) + returns (ShippingSettings) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/shippingSettings}" + }; + option (google.api.method_signature) = "name"; + } + + // Replace the shipping setting of a merchant with the request shipping + // setting. Executing this method requires admin access. + rpc InsertShippingSettings(InsertShippingSettingsRequest) + returns (ShippingSettings) { + option (google.api.http) = { + post: "/accounts/v1beta/{parent=accounts/*}/shippingSettings:insert" + body: "shipping_setting" + }; + } +} + +// The merchant account's [shipping +// setting](https://support.google.com/merchants/answer/6069284). +message ShippingSettings { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/ShippingSettings" + pattern: "accounts/{account}/shippingSettings" + plural: "shippingSettings" + singular: "shippingSettings" + }; + + // Identifier. The resource name of the shipping setting. + // Format: `accounts/{account}/shippingSetting` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The target account's list of services. + repeated Service services = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of warehouses which can be referred to in `services`. + repeated Warehouse warehouses = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. This field is used for avoid async issue. Make sure shipping + // setting data + // didn't change between get call and insert call. The user should do + // following steps: + // + // 1. Set etag field as empty string for initial shipping setting creation. + // + // 2. After initial creation, call get method to obtain an etag and current + // shipping setting data before call insert. + // + // 3. Modify to wanted shipping setting information. + // + // 4. Call insert method with the wanted shipping setting information with + // the etag obtained from step 2. + // + // 5. If shipping setting data changed between step 2 and step 4. Insert + // request will fail because the etag changes every time the shipping setting + // data changes. User should repeate step 2-4 with the new etag. + string etag = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Shipping service. +message Service { + // A list of stores your products are delivered from. + // This is only valid for the local delivery shipment type. + message StoreConfig { + // Configs related to local delivery ends for the day. + message CutoffConfig { + // Time that local delivery ends for the day. + message LocalCutoffTime { + // Hour local delivery orders must be placed by to process the same + // day. + optional int64 hour = 1; + + // Minute local delivery orders must be placed by to process the same + // day. + optional int64 minute = 2; + } + + // Time that local delivery ends for the day. + optional LocalCutoffTime local_cutoff_time = 1; + + // Only valid with local delivery fulfillment. Represents cutoff time + // as the number of hours before store closing. Mutually exclusive + // with `local_cutoff_time`. + optional int64 store_close_offset_hours = 2; + + // Merchants can opt-out of showing n+1 day local delivery when they have + // a shipping service configured to n day local delivery. For example, if + // the shipping service defines same-day delivery, and it's past the + // cut-off, setting this field to `true` results in the calculated + // shipping service rate returning `NO_DELIVERY_POST_CUTOFF`. In the + // same example, setting this field to `false` results in the calculated + // shipping time being one day. This is only for local delivery. + optional bool no_delivery_post_cutoff = 3; + } + + // Indicates whether all stores, or selected stores, listed by the + // merchant provide local delivery. + enum StoreServiceType { + // Did not specify store service type. + STORE_SERVICE_TYPE_UNSPECIFIED = 0; + + // Indicates whether all stores, current and future, listed by this + // merchant provide local delivery. + ALL_STORES = 1; + + // Indicates that only the stores listed in `store_codes` are eligible + // for local delivery. + SELECTED_STORES = 2; + } + + // Indicates whether all stores, or selected stores, listed by this + // merchant provide local delivery. + optional StoreServiceType store_service_type = 1; + + // Optional. A list of store codes that provide local delivery. + // If empty, then `all_stores` must be true. + repeated string store_codes = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Configs related to local delivery ends for the day. + optional CutoffConfig cutoff_config = 3; + + // Maximum delivery radius. + // This is only required for the local delivery shipment type. + optional Distance service_radius = 4; + } + + // [Loyalty program](https://support.google.com/merchants/answer/12922446) + // provided by a merchant. + message LoyaltyProgram { + // Subset of a merchants loyalty program. + message LoyaltyProgramTiers { + // The tier label [tier_label] sub-attribute differentiates offer level + // benefits between each tier. This value is also set in your program + // settings in Merchant Center, and is required for data source changes + // even if your loyalty program only has 1 tier. + optional string tier_label = 1; + } + + // This is the loyalty program label set in your loyalty program settings in + // Merchant Center. This sub-attribute allows Google to map your loyalty + // program to eligible offers. + optional string program_label = 1; + + // Optional. Loyalty program tier of this shipping service. + repeated LoyaltyProgramTiers loyalty_program_tiers = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Shipment type of shipping service. + enum ShipmentType { + // This service did not specify shipment type. + SHIPMENT_TYPE_UNSPECIFIED = 0; + + // This service ships orders to an address chosen by the customer. + DELIVERY = 1; + + // This service ships orders to an address chosen by the customer. + // The order is shipped from a local store near by. + LOCAL_DELIVERY = 2; + + // This service ships orders to an address chosen by the customer. + // The order is shipped from a collection point. + COLLECTION_POINT = 3; + } + + // Required. Free-form name of the service. Must be unique within target + // account. + optional string service_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A boolean exposing the active status of the shipping service. + optional bool active = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The CLDR territory code of the countries to which the service + // applies. + repeated string delivery_countries = 3 + [(google.api.field_behavior) = REQUIRED]; + + // The CLDR code of the currency to which this service applies. Must match + // that of the prices in rate groups. + optional string currency_code = 4; + + // Required. Time spent in various aspects from order to the delivery of the + // product. + optional DeliveryTime delivery_time = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Shipping rate group definitions. Only the last one is allowed to + // have an empty `applicable_shipping_labels`, which means "everything else". + // The other `applicable_shipping_labels` must not overlap. + repeated RateGroup rate_groups = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Type of locations this service ships orders to. + optional ShipmentType shipment_type = 7; + + // Minimum order value for this service. If set, indicates that customers + // will have to spend at least this amount. + // All prices within a service must have the same currency. + // Cannot be set together with minimum_order_value_table. + optional google.shopping.type.Price minimum_order_value = 8; + + // Table of per store minimum order values for the pickup fulfillment type. + // Cannot be set together with minimum_order_value. + optional MinimumOrderValueTable minimum_order_value_table = 9; + + // A list of stores your products are delivered from. + // This is only valid for the local delivery shipment type. + optional StoreConfig store_config = 10; + + // Optional. Loyalty programs that this shipping service is limited to. + repeated LoyaltyProgram loyalty_programs = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Maximum delivery radius. +// This is only required for the local delivery shipment type. +message Distance { + // Unit can differ based on country, it is parameterized to include miles + // and kilometers. + enum Unit { + // Unit unspecified + UNIT_UNSPECIFIED = 0; + + // Unit in miles + MILES = 1; + + // Unit in kilometers + KILOMETERS = 2; + } + + // Integer value of distance. + optional int64 value = 1; + + // Unit can differ based on country, it is parameterized to include miles + // and kilometers. + optional Unit unit = 2; +} + +// A fulfillment warehouse, which stores and handles inventory. +// Next tag: 7 +message Warehouse { + // Required. The name of the warehouse. Must be unique within account. + optional string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Shipping address of the warehouse. + optional Address shipping_address = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The latest time of day that an order can be accepted and begin + // processing. Later orders will be processed in the next day. The time is + // based on the warehouse postal code. + optional WarehouseCutoffTime cutoff_time = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The number of days it takes for this warehouse to pack up and + // ship an item. This is on the warehouse level, but can be overridden on the + // offer level based on the attributes of an item. + optional int64 handling_days = 4 [(google.api.field_behavior) = REQUIRED]; + + // Business days of the warehouse. + // If not set, will be Monday to Friday by default. + optional BusinessDayConfig business_day_config = 5; +} + +// The latest time of day that an order can be accepted and begin processing. +// Later orders will be processed in the next day. The time is based on the +// warehouse postal code. +message WarehouseCutoffTime { + // Required. Hour of the cutoff time until which an order has to be placed to + // be processed in the same day by the warehouse. Hour is based on the + // timezone of warehouse. + optional int32 hour = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Minute of the cutoff time until which an order has to be placed + // to be processed in the same day by the warehouse. Minute is based on the + // timezone of warehouse. + optional int32 minute = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Shipping address of the warehouse. +message Address { + // Street-level part of the address. For example: `111w 31st Street`. + optional string street_address = 1; + + // Required. City, town or commune. May also include dependent localities or + // sublocalities (For example neighborhoods or suburbs). + optional string city = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Top-level administrative subdivision of the country. For example, + // a state like California ("CA") or a province like Quebec ("QC"). + optional string administrative_area = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Postal code or ZIP (For example "94043"). + optional string postal_code = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. [CLDR country + // code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) + // (For example "US"). + optional string region_code = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Time spent in various aspects from order to the delivery of the product. +message DeliveryTime { + // Minimum number of business days that is spent in transit. 0 means same + // day delivery, 1 means next day delivery. + // Either `min_transit_days`, `max_transit_days` or + // `transit_time_table` must be set, but not both. + optional int32 min_transit_days = 1; + + // Maximum number of business days that is spent in transit. 0 means same + // day delivery, 1 means next day delivery. Must be greater than or equal + // to `min_transit_days`. + optional int32 max_transit_days = 2; + + // Business days cutoff time definition. + // If not configured the cutoff time will be defaulted to 8AM PST. + optional CutoffTime cutoff_time = 3; + + // 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 + // and column dimensions. Either `min_transit_days`, `max_transit_days` or + // `transit_time_table` can be set, but not both. + optional TransitTable transit_time_table = 6; + + // The business days during which orders can be handled. + // If not provided, Monday to Friday business days will be assumed. + optional BusinessDayConfig handling_business_day_config = 7; + + // The business days during which orders can be in-transit. + // If not provided, Monday to Friday business days will be assumed. + optional BusinessDayConfig transit_business_day_config = 8; + + // Optional. Indicates that the delivery time should be calculated per + // warehouse (shipping origin location) based on the settings of the selected + // carrier. When set, no other transit time related field in [delivery + // time][[google.shopping.content.bundles.ShippingSetting.DeliveryTime] should + // be set. + repeated WarehouseBasedDeliveryTime warehouse_based_delivery_times = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Business days cutoff time definition. +message CutoffTime { + // Required. Hour of the cutoff time until which an order has to be placed to + // be processed in the same day. + optional int32 hour = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Minute of the cutoff time until which an order has to be placed + // to be processed in the same day. + optional int32 minute = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. [Timezone + // identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) + // For example "Europe/Zurich". + optional string time_zone = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Business days of the warehouse. +message BusinessDayConfig { + enum Weekday { + WEEKDAY_UNSPECIFIED = 0; + + MONDAY = 1; + + TUESDAY = 2; + + WEDNESDAY = 3; + + THURSDAY = 4; + + FRIDAY = 5; + + SATURDAY = 6; + + SUNDAY = 7; + } + + // Required. Regular business days. + // May not be empty. + repeated Weekday business_days = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Indicates that the delivery time should be calculated per warehouse +// (shipping origin location) based on the settings of the selected carrier. +// When set, no other transit time related field in `delivery_time` should be +// set. +message WarehouseBasedDeliveryTime { + // Required. Carrier, such as `"UPS"` or `"Fedex"`. + optional string carrier = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Carrier service, such as `"ground"` or `"2 days"`. The name of + // the service must be in the eddSupportedServices list. + optional string carrier_service = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Warehouse name. This should match + // [warehouse][ShippingSetting.warehouses.name] + optional string warehouse = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Shipping rate group definitions. Only the last one is allowed to have an +// empty `applicable_shipping_labels`, which means +// "everything else". The other `applicable_shipping_labels` must +// not overlap. +message RateGroup { + // Required. A list of [shipping + // labels](https://support.google.com/merchants/answer/6324504) defining the + // products to which this rate group applies to. This is a disjunction: only + // one of the labels has to match for the rate group to apply. May only be + // empty for the last rate group of a service. + repeated string applicable_shipping_labels = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The value of the rate group (For example flat rate $10). Can only be set + // if `main_table` and `subtables` are not set. + optional Value single_value = 2; + + // A table defining the rate group, when `single_value` is not + // expressive enough. Can only be set if `single_value` is not + // set. + optional Table main_table = 3; + + // Optional. A list of subtables referred to by `main_table`. Can only + // be set if `main_table` is set. + repeated Table subtables = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of carrier rates that can be referred to by + // `main_table` or `single_value`. + repeated CarrierRate carrier_rates = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Name of the rate group. + // If set has to be unique within shipping service. + optional string name = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A table defining the rate group, when `single_value` is not +// expressive enough. +message Table { + // Name of the table. Required for subtables, ignored for the main table. + optional string name = 1; + + // Required. Headers of the table's rows. + optional Headers row_headers = 2 [(google.api.field_behavior) = REQUIRED]; + + // Headers of the table's columns. Optional: if not set then the table has + // only one dimension. + optional Headers column_headers = 3; + + // Required. The list of rows that constitute the table. Must have the same + // length as `row_headers`. + repeated Row rows = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Transit time table, number of business days spent in transit based on row +// and column dimensions. Either `min_transit_days`, `max_transit_days` or +// `transit_time_table` can be set, but not both. +message TransitTable { + // If there's only one dimension set of `postal_code_group_names` or + // `transit_time_labels`, there are multiple rows each with one value + // for that dimension. If there are two dimensions, each row corresponds to a + // `postal_code_group_names`, and columns (values) to a + // `transit_time_labels`. + message TransitTimeRow { + // Transit time range (min-max) in business days. + message TransitTimeValue { + // Minimum transit time range in business days. 0 means same + // day delivery, 1 means next day delivery. + optional int32 min_transit_days = 1; + + // Must be greater than or equal to `min_transit_days`. + optional int32 max_transit_days = 2; + } + + // Required. Transit time range (min-max) in business days. + repeated TransitTimeValue values = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Required. A list of region names + // [Region.name][google.shopping.merchant.accounts.v1beta.Region.name] . The + // last value can be + // `"all other locations"`. Example: + // `["zone 1", "zone 2", "all other locations"]`. The referred + // postal code groups must match the delivery country of the service. + repeated string postal_code_group_names = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of transit time labels. The last value can be + // `"all other labels"`. Example: + // `["food", "electronics", "all other labels"]`. + repeated string transit_time_labels = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. If there's only one dimension set of `postal_code_group_names` or + // `transit_time_labels`, there are multiple rows each with one value + // for that dimension. If there are two dimensions, each row corresponds to a + // `postal_code_group_names`, and columns (values) to a + // `transit_time_labels`. + repeated TransitTimeRow rows = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Table of per store minimum order values for the pickup fulfillment type. +message MinimumOrderValueTable { + // A list of store code sets sharing the same minimum order value. At least + // two sets are required and the last one must be empty, which signifies + // 'MOV for all other stores'. + // Each store code can only appear once across all the sets. + // All prices within a service must have the same currency. + message StoreCodeSetWithMov { + // Optional. A list of unique store codes or empty for the catch all. + repeated string store_codes = 1 [(google.api.field_behavior) = OPTIONAL]; + + // The minimum order value for the given stores. + optional google.shopping.type.Price value = 2; + } + + // Required. A list of store code sets sharing the same minimum order value + // (MOV). At least two sets are required and the last one must be empty, which + // signifies 'MOV for all other stores'. Each store code can only appear once + // across all the sets. All prices within a service must have the same + // currency. + repeated StoreCodeSetWithMov store_code_set_with_movs = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// A non-empty list of row or column headers for a table. +// Exactly one of `prices`, `weights`, +// `num_items`, `postal_code_group_names`, or +// `location` must be set. +message Headers { + // Required. A list of inclusive order price upper bounds. The last price's + // value can be infinity by setting price amount_micros = -1. For example + // `[{"amount_micros": 10000000, "currency_code": "USD"}, + // {"amount_micros": 500000000, "currency_code": "USD"}, + // {"amount_micros": -1, "currency_code": "USD"}]` represents the headers + // "<= $10", "<= $500", and "> $500". All prices within a service must have + // the same currency. Must be non-empty. Must be positive except -1. Can only + // be set if all other fields are not set. + repeated google.shopping.type.Price prices = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of inclusive order weight upper bounds. The last weight's + // value can be infinity by setting price amount_micros = -1. For example + // `[{"amount_micros": 10000000, "unit": "kg"}, {"amount_micros": 50000000, + // "unit": "kg"}, + // {"amount_micros": -1, "unit": "kg"}]` represents the headers + // "<= 10kg", "<= 50kg", and "> 50kg". All weights within a service must have + // the same unit. Must be non-empty. Must be positive except -1. Can only be + // set if all other fields are not set. + repeated google.shopping.type.Weight weights = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of inclusive number of items upper bounds. The last value + // can be + // `"infinity"`. For example + // `["10", "50", "infinity"]` represents the headers + // "<= 10 items", "<= 50 items", and "> 50 items". Must be non-empty. Can + // only be set if all other fields are not set. + repeated string number_of_items = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of postal group names. The last value can be + // `"all other locations"`. Example: + // `["zone 1", "zone 2", "all other locations"]`. The referred + // postal code groups must match the delivery country of the service. Must + // be non-empty. Can only be set if all other fields are not set. + repeated string postal_code_group_names = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Required. A list of location ID sets. Must be non-empty. Can only be set if + // all other fields are not set. + repeated LocationIdSet locations = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// A list of location ID sets. Must be non-empty. Can only be set if all +// other fields are not set. +message LocationIdSet { + // Required. A non-empty list of + // [location + // IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). + // They must all be of the same location type (For + // example, state). + repeated string location_ids = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Include a list of cells. +message Row { + // Required. The list of cells that constitute the row. Must have the same + // length as `columnHeaders` for two-dimensional tables, a length of 1 for + // one-dimensional tables. + repeated Value cells = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The single value of a rate group or the value of a rate group table's cell. +// Exactly one of `no_shipping`, `flat_rate`, +// `price_percentage`, `carrier_rateName`, +// `subtable_name` must be set. +message Value { + // If true, then the product can't be shipped. Must be true when set, can only + // be set if all other fields are not set. + optional bool no_shipping = 1; + + // A flat rate. Can only be set if all other fields are not set. + optional google.shopping.type.Price flat_rate = 2; + + // A percentage of the price represented as a number in decimal notation + // (For example, `"5.4"`). Can only be set if all other fields are not + // set. + optional string price_percentage = 3; + + // The name of a carrier rate referring to a carrier rate defined in the + // same rate group. Can only be set if all other fields are not set. + optional string carrier_rate = 4; + + // The name of a subtable. Can only be set in table cells (For example, not + // for single values), and only if all other fields are not set. + optional string subtable = 5; +} + +// A list of carrier rates that can be referred to by +// `main_table` or `single_value`. +message CarrierRate { + // Required. Name of the carrier rate. Must be unique per rate group. + optional string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Carrier service, such as `"UPS"` or `"Fedex"`. + optional string carrier = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Carrier service, such as `"ground"` or `"2 days"`. + optional string carrier_service = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Shipping origin for this carrier rate. + optional string origin_postal_code = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Multiplicative shipping rate modifier as a number in decimal + // notation. Can be negative. For example `"5.4"` increases the rate by 5.4%, + // `"-3"` decreases the rate by 3%. + optional string percentage_adjustment = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additive shipping rate modifier. Can be negative. For example + // `{ "amount_micros": 1, "currency_code" : "USD" }` adds $1 to the rate, + // `{ "amount_micros": -3, "currency_code" : "USD" }` removes $3 from the + // rate. + optional google.shopping.type.Price flat_adjustment = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the `GetShippingSetting` method. +message GetShippingSettingsRequest { + // Required. The name of the shipping setting to retrieve. + // Format: `accounts/{account}/shippingsetting` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/ShippingSettings" + } + ]; +} + +// Request message for the `InsertShippingSetting` method. +message InsertShippingSettingsRequest { + // Required. The account where this product will be inserted. + // Format: accounts/{account} + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new version of the account. + ShippingSettings shipping_setting = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/tax_rule.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/tax_rule.proto new file mode 100644 index 00000000000..a3217675d9d --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/tax_rule.proto @@ -0,0 +1,87 @@ +// 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/field_behavior.proto"; +import "google/type/interval.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "TaxRuleProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Primary type convension +// +// percent micro : 100% = 1 000 000 and 1% = 10 000 +// cannot be negative. +// +// Information about tax nexus and related parameters applicable to orders +// delivered to the area covered by a single tax admin. Nexus is created when a +// merchant is doing business in an area administered by tax admin (only US +// states are supported for nexus configuration). If merchant has nexus in a US +// state, merchant needs to pay tax to all tax authorities associated with +// the shipping destination. +// Next Id : 8 +message TaxRule { + // A range of postal codes that defines the area. + message TaxPostalCodeRange { + // Required. The start of the postal code range, which is also the smallest + // in the range. + string start = 1 [(google.api.field_behavior) = REQUIRED]; + + // The end of the postal code range. Will be the same as start if not + // specified. + string end = 2; + } + + // Describe the location through either postal code range or a criteria id. + oneof location { + // The admin_id or criteria_id of the region in which this rule is + // applicable. + int64 location_id = 2; + + // The range of postal codes in which this rule is applicable. + TaxPostalCodeRange post_code_range = 3; + } + + // What is the way to calculate tax rate for deliveries to this admin's area. + // Can only be set on US states. + oneof rate_calculation { + // Rate that depends on delivery location: if merchant has a nexus in + // corresponding US state, rates from authorities with jurisdiction over + // delivery area are added up. + bool use_google_rate = 4; + + // A fixed rate specified in micros, where 100% = 1_000_000. + // Suitable for origin-based states. + int64 self_specified_rate_micros = 5; + } + + // Region code in which this rule is applicable + string region_code = 1; + + // If set, shipping charge is taxed (at the same rate as product) when + // delivering to this admin's area. + // Can only be set on US states without category. + bool shipping_taxed = 6; + + // Required. Time period when this rule is effective. If the duration is + // missing from effective_time listed, then it is open ended to the future. + // The start of this time period is inclusive, and the end is exclusive. + google.type.Interval effective_time_period = 7 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto new file mode 100644 index 00000000000..86c0c37aaaf --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto @@ -0,0 +1,145 @@ +// 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/empty.proto"; +import "google/shopping/merchant/accounts/v1beta/termsofservicekind.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "TermsOfServiceProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support `TermsOfService` API. +service TermsOfServiceService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves the `TermsOfService` associated with the provided version. + rpc GetTermsOfService(GetTermsOfServiceRequest) returns (TermsOfService) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=termsOfService/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the latest version of the `TermsOfService` for a given `kind` and + // `region_code`. + rpc RetrieveLatestTermsOfService(RetrieveLatestTermsOfServiceRequest) + returns (TermsOfService) { + option (google.api.http) = { + get: "/accounts/v1beta/termsOfService:retrieveLatest" + }; + } + + // Accepts a `TermsOfService`. Executing this method requires admin access. + rpc AcceptTermsOfService(AcceptTermsOfServiceRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=termsOfService/*}:accept" + }; + option (google.api.method_signature) = "name"; + } +} + +// A `TermsOfService`. +message TermsOfService { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/TermsOfService" + pattern: "termsOfService/{version}" + }; + + // Identifier. The resource name of the terms of service version. + // Format: `termsOfService/{version}` + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/TermsOfService" + } + ]; + + // Region code as defined by [CLDR](https://cldr.unicode.org/). This is either + // a country where the ToS applies specifically to that country or `001` when + // the same `TermsOfService` can be signed in any country. However note that + // when signing a ToS that applies globally we still expect that a specific + // country is provided (this should be merchant business country or program + // country of participation). + string region_code = 2; + + // The Kind this terms of service version applies to. + TermsOfServiceKind kind = 3; + + // URI for terms of service file that needs to be displayed to signing users. + optional string file_uri = 4; + + // Whether this terms of service version is external. External terms of + // service versions can only be agreed through external processes and not + // directly by the merchant through UI or API. + bool external = 5; +} + +// Request message for the `GetTermsOfService` method. +message GetTermsOfServiceRequest { + // Required. The resource name of the terms of service version. + // Format: `termsOfService/{version}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/TermsOfService" + } + ]; +} + +// Request message for the `RetrieveLatestTermsOfService` method. +message RetrieveLatestTermsOfServiceRequest { + // 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]; + + // Required. The Kind this terms of service version applies to. + TermsOfServiceKind kind = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `AcceptTermsOfService` method. +message AcceptTermsOfServiceRequest { + // Required. The resource name of the terms of service version. + // Format: `termsOfService/{version}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/TermsOfService" + } + ]; + + // Required. The account for which to accept the ToS. + string account = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; + + // 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 = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto new file mode 100644 index 00000000000..df3d93436d2 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto @@ -0,0 +1,169 @@ +// 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/shopping/merchant/accounts/v1beta/termsofservicekind.proto"; +import "google/type/date.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "TermsOfServiceAgreementStateProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support `TermsOfServiceAgreementState` API. +service TermsOfServiceAgreementStateService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Returns the state of a terms of service agreement. + rpc GetTermsOfServiceAgreementState(GetTermsOfServiceAgreementStateRequest) + returns (TermsOfServiceAgreementState) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/termsOfServiceAgreementStates/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves the state of the agreement for the application terms of service. + rpc RetrieveForApplicationTermsOfServiceAgreementState( + RetrieveForApplicationTermsOfServiceAgreementStateRequest) + returns (TermsOfServiceAgreementState) { + option (google.api.http) = { + get: "/accounts/v1beta/{parent=accounts/*}/termsOfServiceAgreementStates:retrieveForApplication" + }; + option (google.api.method_signature) = "parent"; + } +} + +// This resource represents the agreement state for a given account and terms of +// service kind. +// The state is as follows: +// +// * If the merchant has accepted a terms of service: +// [accepted](TermsOfServiceAggrementState.accepted) will be populated, +// otherwise it will be empty +// * If the merchant must sign a terms of service: +// [required](TermsOfServiceAggrementState.required) will be populated, +// otherwise it will be empty. +// +// Note that both [required](TermsOfServiceAggrementState.required) and +// [accepted](TermsOfServiceAggrementState.accepted) can be present. In this +// case the `accepted` terms of services will have an expiration date set in the +// [valid_until](Accepted.valid_until) field. The `required` terms of services +// need to be accepted before `valid_until` in order for the account to continue +// having a valid agreement. When accepting new terms of services we expect 3Ps +// to display the text associated with the given terms of service agreement (the +// url to the file containing the text is added in the Required message below as +// [tos_file_uri](Accepted.tos_file_uri). The actual acceptance of the terms of +// service is done by calling accept on the [TermsOfService](TermsOfService) +// resource. +message TermsOfServiceAgreementState { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/TermsOfServiceAgreementState" + pattern: "accounts/{account}/termsOfServiceAgreementStates/{identifier}" + plural: "termsOfServiceAgreementStates" + singular: "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 + // country the current state applies to. + string region_code = 2; + + // Terms of Service kind associated with the particular version. + TermsOfServiceKind terms_of_service_kind = 3; + + // The accepted terms of service of this kind and for the associated + // region_code + optional Accepted accepted = 4; + + // The required terms of service + optional Required required = 5; +} + +// Describes the accepted terms of service. +message Accepted { + // The accepted + // [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService). + string terms_of_service = 1 [(google.api.resource_reference) = { + type: "merchantapi.googleapis.com/TermsOfService" + }]; + + // The account where the acceptance was recorded. This can be the account + // itself or, in the case of subaccounts, the MCA account. + string accepted_by = 2 [(google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + }]; + + // When set, it states that the accepted + // [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + // is only valid until the end of this date (in UTC). A new one must be + // accepted before then. The information of the required + // [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + // is found in the [Required](Required) message. + optional google.type.Date valid_until = 3; +} + +// Describes the terms of service which are required to be accepted. +message Required { + // The + // [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) + // that need to be accepted. + string terms_of_service = 1 [(google.api.resource_reference) = { + type: "merchantapi.googleapis.com/TermsOfService" + }]; + + // Full URL to the terms of service file. This field is the same as + // [TermsOfService.file_uri](TermsOfService.file_uri), it is added + // here for convenience only. + string tos_file_uri = 2; +} + +// Request message for the `GetTermsOfServiceAgreementState` method. +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) = { + type: "merchantapi.googleapis.com/TermsOfServiceAgreementState" + } + ]; +} + +// Request message for the `RetrieveForApplicationTermsOfServiceAgreementState` +// method. +message RetrieveForApplicationTermsOfServiceAgreementStateRequest { + // Required. The account for which to get a TermsOfServiceAgreementState + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/TermsOfServiceAgreementState" + } + ]; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservicekind.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservicekind.proto new file mode 100644 index 00000000000..96848981d7e --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservicekind.proto @@ -0,0 +1,31 @@ +// 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; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "TermsOfServiceKindProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// The TermsOfService Kind. +enum TermsOfServiceKind { + // Default value. This value is unused. + TERMS_OF_SERVICE_KIND_UNSPECIFIED = 0; + + // Merchant Center application. + MERCHANT_CENTER = 1; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/user.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/user.proto new file mode 100644 index 00000000000..7f4d2bb3cb8 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/user.proto @@ -0,0 +1,217 @@ +// 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/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/shopping/merchant/accounts/v1beta/accessright.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; +option java_multiple_files = true; +option java_outer_classname = "UserProto"; +option java_package = "com.google.shopping.merchant.accounts.v1beta"; + +// Service to support user API. +service UserService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Retrieves a Merchant Center account user. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/accounts/v1beta/{name=accounts/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a Merchant Center account user. Executing this method requires + // admin access. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/accounts/v1beta/{parent=accounts/*}/users" + body: "user" + }; + option (google.api.method_signature) = "parent,user"; + } + + // Deletes a Merchant Center account user. Executing this method requires + // admin access. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/accounts/v1beta/{name=accounts/*/users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a Merchant Center account user. Executing this method requires + // admin access. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/accounts/v1beta/{user.name=accounts/*/users/*}" + body: "user" + }; + option (google.api.method_signature) = "user,update_mask"; + } + + // Lists all users of a Merchant Center account. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/accounts/v1beta/{parent=accounts/*}/users" + }; + option (google.api.method_signature) = "parent"; + } +} + +// A [user](https://support.google.com/merchants/answer/12160472). +message User { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/User" + pattern: "accounts/{account}/users/{email}" + plural: "users" + singular: "user" + }; + + // The possible states of a user. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The user is pending confirmation. In this state, the user first needs to + // accept the invitation before performing other actions. + PENDING = 1; + + // The user is verified. + VERIFIED = 2; + } + + // Identifier. The resource name of the user. + // Format: `accounts/{account}/user/{email}` + // + // Use `me` to refer to your own email address, for example + // `accounts/{account}/users/me`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The state of the user. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The [access + // rights](https://support.google.com/merchants/answer/12160472?sjid=6789834943175119429-EU#accesstypes) + // the user has. + repeated AccessRight access_rights = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the `GetUser` method. +message GetUserRequest { + // Required. The name of the user to retrieve. + // Format: `accounts/{account}/users/{email}` + // + // It is also possible to retrieve the user corresponding to the caller by + // using `me` rather than an email address as in + // `accounts/{account}/users/me`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/User" + } + ]; +} + +// Request message for the `CreateUser` method. +message CreateUserRequest { + // Required. The resource name of the account for which a user will be + // created. Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; + + // Required. The email address of the user (for example, + // `john.doe@gmail.com`). + string user_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The user to create. + User user = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `DeleteUser` method. +message DeleteUserRequest { + // Required. The name of the user to delete. + // Format: `accounts/{account}/users/{email}` + // + // It is also possible to delete the user corresponding to the caller by using + // `me` rather than an email address as in `accounts/{account}/users/me`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/User" + } + ]; +} + +// Request message for the `UpdateUser` method. +message UpdateUserRequest { + // Required. The new version of the user. + // + // Use `me` to refer to your own email address, for example + // `accounts/{account}/users/me`. + User user = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of fields being updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `ListUsers` method. +message ListUsersRequest { + // Required. The parent, which owns this collection of users. + // Format: `accounts/{account}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/Account" + } + ]; + + // Optional. The maximum number of users to return. The service may return + // fewer than this value. If unspecified, at most 50 users will be returned. + // The maximum value is 100; values above 100 will be coerced to 100 + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListUsers` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListUsers` must match + // the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the `ListUsers` method. +message ListUsersResponse { + // The users from the specified account. + repeated User users = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/type/types.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/type/types.proto new file mode 100644 index 00000000000..0d219e72d6a --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/type/types.proto @@ -0,0 +1,193 @@ +// 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.type; + +option csharp_namespace = "Google.Shopping.Type"; +option go_package = "cloud.google.com/go/shopping/type/typepb;typepb"; +option java_multiple_files = true; +option java_outer_classname = "TypesProto"; +option java_package = "com.google.shopping.type"; + +// The weight represented as the value in string and the unit. +message Weight { + // The weight unit. + enum WeightUnit { + // unit unspecified + WEIGHT_UNIT_UNSPECIFIED = 0; + + // lb unit. + POUND = 1; + + // kg unit. + KILOGRAM = 2; + } + + // Required. The weight represented as a number in micros (1 million micros is + // an equivalent to one's currency standard unit, for example, 1 kg = 1000000 + // micros). + // This field can also be set as infinity by setting to -1. + // This field only support -1 and positive value. + optional int64 amount_micros = 1; + + // Required. The weight unit. + // Acceptable values are: kg and lb + WeightUnit unit = 2; +} + +// The price represented as a number and currency. +message Price { + // The price represented as a number in micros (1 million micros is an + // equivalent to one's currency standard unit, for example, 1 USD = 1000000 + // micros). + optional int64 amount_micros = 1; + + // The currency of the price using three-letter acronyms according to [ISO + // 4217](http://en.wikipedia.org/wiki/ISO_4217). + optional string currency_code = 2; +} + +// A message that represents custom attributes. Exactly one of `value` or +// `group_values` must not be empty. +message CustomAttribute { + // The name of the attribute. + optional string name = 1; + + // The value of the attribute. If `value` is not empty, `group_values` must be + // empty. + optional string value = 2; + + // Subattributes within this attribute group. If + // `group_values` is not empty, `value` must be empty. + repeated CustomAttribute group_values = 3; +} + +// Destinations available for a product. +// +// Destinations are used in Merchant Center to allow you to control where the +// products from your data feed should be displayed. +// +message Destination { + // Destination values. + enum DestinationEnum { + // Not specified. + DESTINATION_ENUM_UNSPECIFIED = 0; + + // [Shopping ads](https://support.google.com/google-ads/answer/2454022). + SHOPPING_ADS = 1; + + // [Display ads](https://support.google.com/merchants/answer/6069387). + DISPLAY_ADS = 2; + + // [Local inventory + // ads](https://support.google.com/merchants/answer/3057972). + LOCAL_INVENTORY_ADS = 3; + + // [Free listings](https://support.google.com/merchants/answer/9199328). + FREE_LISTINGS = 4; + + // [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + FREE_LOCAL_LISTINGS = 5; + + // [YouTube Shopping](https://support.google.com/merchants/answer/12362804). + YOUTUBE_SHOPPING = 6; + } +} + +// Reporting contexts that your account and product issues apply to. +// +// Reporting contexts are groups of surfaces and formats for product results on +// Google. They can represent the entire destination (for example, [Shopping +// ads](https://support.google.com/merchants/answer/6149970)) or a subset of +// formats within a destination (for example, [Demand Gen +// ads](https://support.google.com/merchants/answer/13389785)). +// +message ReportingContext { + // Reporting context values. + enum ReportingContextEnum { + // Not specified. + REPORTING_CONTEXT_ENUM_UNSPECIFIED = 0; + + // [Shopping ads](https://support.google.com/merchants/answer/6149970). + SHOPPING_ADS = 1; + + // Deprecated: Use `DEMAND_GEN_ADS` instead. + // [Discovery and Demand Gen + // ads](https://support.google.com/merchants/answer/13389785). + DISCOVERY_ADS = 2 [deprecated = true]; + + // [Demand Gen ads](https://support.google.com/merchants/answer/13389785). + DEMAND_GEN_ADS = 13; + + // [Demand Gen ads on Discover + // surface](https://support.google.com/merchants/answer/13389785). + DEMAND_GEN_ADS_DISCOVER_SURFACE = 14; + + // [Video ads](https://support.google.com/google-ads/answer/6340491). + VIDEO_ADS = 3; + + // [Display ads](https://support.google.com/merchants/answer/6069387). + DISPLAY_ADS = 4; + + // [Local inventory + // ads](https://support.google.com/merchants/answer/3271956). + LOCAL_INVENTORY_ADS = 5; + + // [Vehicle inventory + // ads](https://support.google.com/merchants/answer/11544533). + VEHICLE_INVENTORY_ADS = 6; + + // [Free product + // listings](https://support.google.com/merchants/answer/9199328). + FREE_LISTINGS = 7; + + // [Free local product + // listings](https://support.google.com/merchants/answer/9825611). + FREE_LOCAL_LISTINGS = 8; + + // [Free local vehicle + // listings](https://support.google.com/merchants/answer/11544533). + FREE_LOCAL_VEHICLE_LISTINGS = 9; + + // [YouTube + // Shopping](https://support.google.com/merchants/answer/13478370). + YOUTUBE_SHOPPING = 10; + + // [Cloud retail](https://cloud.google.com/solutions/retail). + CLOUD_RETAIL = 11; + + // [Local cloud retail](https://cloud.google.com/solutions/retail). + LOCAL_CLOUD_RETAIL = 12; + } +} + +// [Channel](https://support.google.com/merchants/answer/7361332) of a product. +// +// Channel is used to distinguish between online and local products. +message Channel { + // Channel values. + enum ChannelEnum { + // Not specified. + CHANNEL_ENUM_UNSPECIFIED = 0; + + // Online product. + ONLINE = 1; + + // Local product. + LOCAL = 2; + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.d.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.d.ts new file mode 100644 index 00000000000..e8ff635d1b8 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.d.ts @@ -0,0 +1,22846 @@ +// 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace shopping. */ + namespace shopping { + + /** Namespace merchant. */ + namespace merchant { + + /** Namespace accounts. */ + namespace accounts { + + /** Namespace v1beta. */ + namespace v1beta { + + /** AccessRight enum. */ + enum AccessRight { + ACCESS_RIGHT_UNSPECIFIED = 0, + STANDARD = 1, + ADMIN = 2, + PERFORMANCE_REPORTING = 3 + } + + /** Represents an AccountTaxService */ + class AccountTaxService extends $protobuf.rpc.Service { + + /** + * Constructs a new AccountTaxService 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 AccountTaxService 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): AccountTaxService; + + /** + * Calls GetAccountTax. + * @param request GetAccountTaxRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AccountTax + */ + public getAccountTax(request: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, callback: google.shopping.merchant.accounts.v1beta.AccountTaxService.GetAccountTaxCallback): void; + + /** + * Calls GetAccountTax. + * @param request GetAccountTaxRequest message or plain object + * @returns Promise + */ + public getAccountTax(request: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest): Promise; + + /** + * Calls ListAccountTax. + * @param request ListAccountTaxRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAccountTaxResponse + */ + public listAccountTax(request: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, callback: google.shopping.merchant.accounts.v1beta.AccountTaxService.ListAccountTaxCallback): void; + + /** + * Calls ListAccountTax. + * @param request ListAccountTaxRequest message or plain object + * @returns Promise + */ + public listAccountTax(request: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest): Promise; + + /** + * Calls UpdateAccountTax. + * @param request UpdateAccountTaxRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AccountTax + */ + public updateAccountTax(request: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, callback: google.shopping.merchant.accounts.v1beta.AccountTaxService.UpdateAccountTaxCallback): void; + + /** + * Calls UpdateAccountTax. + * @param request UpdateAccountTaxRequest message or plain object + * @returns Promise + */ + public updateAccountTax(request: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest): Promise; + } + + namespace AccountTaxService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|getAccountTax}. + * @param error Error, if any + * @param [response] AccountTax + */ + type GetAccountTaxCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.AccountTax) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|listAccountTax}. + * @param error Error, if any + * @param [response] ListAccountTaxResponse + */ + type ListAccountTaxCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|updateAccountTax}. + * @param error Error, if any + * @param [response] AccountTax + */ + type UpdateAccountTaxCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.AccountTax) => void; + } + + /** Properties of an AccountTax. */ + interface IAccountTax { + + /** AccountTax name */ + name?: (string|null); + + /** AccountTax account */ + account?: (number|Long|string|null); + + /** AccountTax taxRules */ + taxRules?: (google.shopping.merchant.accounts.v1beta.ITaxRule[]|null); + } + + /** Represents an AccountTax. */ + class AccountTax implements IAccountTax { + + /** + * Constructs a new AccountTax. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IAccountTax); + + /** AccountTax name. */ + public name: string; + + /** AccountTax account. */ + public account: (number|Long|string); + + /** AccountTax taxRules. */ + public taxRules: google.shopping.merchant.accounts.v1beta.ITaxRule[]; + + /** + * Creates a new AccountTax instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountTax instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IAccountTax): google.shopping.merchant.accounts.v1beta.AccountTax; + + /** + * Encodes the specified AccountTax message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountTax.verify|verify} messages. + * @param message AccountTax message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IAccountTax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccountTax message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountTax.verify|verify} messages. + * @param message AccountTax message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAccountTax, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountTax message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccountTax + * @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.AccountTax; + + /** + * Decodes an AccountTax message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccountTax + * @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.AccountTax; + + /** + * Verifies an AccountTax 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 AccountTax message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccountTax + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AccountTax; + + /** + * Creates a plain object from an AccountTax message. Also converts values to other types if specified. + * @param message AccountTax + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.AccountTax, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccountTax to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccountTax + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAccountTaxRequest. */ + interface IGetAccountTaxRequest { + + /** GetAccountTaxRequest name */ + name?: (string|null); + } + + /** Represents a GetAccountTaxRequest. */ + class GetAccountTaxRequest implements IGetAccountTaxRequest { + + /** + * Constructs a new GetAccountTaxRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest); + + /** GetAccountTaxRequest name. */ + public name: string; + + /** + * Creates a new GetAccountTaxRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAccountTaxRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest): google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest; + + /** + * Encodes the specified GetAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest.verify|verify} messages. + * @param message GetAccountTaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest.verify|verify} messages. + * @param message GetAccountTaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAccountTaxRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAccountTaxRequest + * @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.GetAccountTaxRequest; + + /** + * Decodes a GetAccountTaxRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAccountTaxRequest + * @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.GetAccountTaxRequest; + + /** + * Verifies a GetAccountTaxRequest 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 GetAccountTaxRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAccountTaxRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest; + + /** + * Creates a plain object from a GetAccountTaxRequest message. Also converts values to other types if specified. + * @param message GetAccountTaxRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAccountTaxRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAccountTaxRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAccountTaxRequest. */ + interface IUpdateAccountTaxRequest { + + /** UpdateAccountTaxRequest accountTax */ + accountTax?: (google.shopping.merchant.accounts.v1beta.IAccountTax|null); + + /** UpdateAccountTaxRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAccountTaxRequest. */ + class UpdateAccountTaxRequest implements IUpdateAccountTaxRequest { + + /** + * Constructs a new UpdateAccountTaxRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest); + + /** UpdateAccountTaxRequest accountTax. */ + public accountTax?: (google.shopping.merchant.accounts.v1beta.IAccountTax|null); + + /** UpdateAccountTaxRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAccountTaxRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAccountTaxRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest): google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest; + + /** + * Encodes the specified UpdateAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.verify|verify} messages. + * @param message UpdateAccountTaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.verify|verify} messages. + * @param message UpdateAccountTaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAccountTaxRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAccountTaxRequest + * @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.UpdateAccountTaxRequest; + + /** + * Decodes an UpdateAccountTaxRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAccountTaxRequest + * @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.UpdateAccountTaxRequest; + + /** + * Verifies an UpdateAccountTaxRequest 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 UpdateAccountTaxRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAccountTaxRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest; + + /** + * Creates a plain object from an UpdateAccountTaxRequest message. Also converts values to other types if specified. + * @param message UpdateAccountTaxRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAccountTaxRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAccountTaxRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAccountTaxRequest. */ + interface IListAccountTaxRequest { + + /** ListAccountTaxRequest parent */ + parent?: (string|null); + + /** ListAccountTaxRequest pageSize */ + pageSize?: (number|null); + + /** ListAccountTaxRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAccountTaxRequest. */ + class ListAccountTaxRequest implements IListAccountTaxRequest { + + /** + * Constructs a new ListAccountTaxRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest); + + /** ListAccountTaxRequest parent. */ + public parent: string; + + /** ListAccountTaxRequest pageSize. */ + public pageSize: number; + + /** ListAccountTaxRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAccountTaxRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAccountTaxRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest): google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest; + + /** + * Encodes the specified ListAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest.verify|verify} messages. + * @param message ListAccountTaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest.verify|verify} messages. + * @param message ListAccountTaxRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAccountTaxRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAccountTaxRequest + * @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.ListAccountTaxRequest; + + /** + * Decodes a ListAccountTaxRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAccountTaxRequest + * @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.ListAccountTaxRequest; + + /** + * Verifies a ListAccountTaxRequest 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 ListAccountTaxRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAccountTaxRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest; + + /** + * Creates a plain object from a ListAccountTaxRequest message. Also converts values to other types if specified. + * @param message ListAccountTaxRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAccountTaxRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAccountTaxRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAccountTaxResponse. */ + interface IListAccountTaxResponse { + + /** ListAccountTaxResponse accountTaxes */ + accountTaxes?: (google.shopping.merchant.accounts.v1beta.IAccountTax[]|null); + + /** ListAccountTaxResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAccountTaxResponse. */ + class ListAccountTaxResponse implements IListAccountTaxResponse { + + /** + * Constructs a new ListAccountTaxResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse); + + /** ListAccountTaxResponse accountTaxes. */ + public accountTaxes: google.shopping.merchant.accounts.v1beta.IAccountTax[]; + + /** ListAccountTaxResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAccountTaxResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAccountTaxResponse instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse): google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse; + + /** + * Encodes the specified ListAccountTaxResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.verify|verify} messages. + * @param message ListAccountTaxResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAccountTaxResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.verify|verify} messages. + * @param message ListAccountTaxResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAccountTaxResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAccountTaxResponse + * @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.ListAccountTaxResponse; + + /** + * Decodes a ListAccountTaxResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAccountTaxResponse + * @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.ListAccountTaxResponse; + + /** + * Verifies a ListAccountTaxResponse 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 ListAccountTaxResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAccountTaxResponse + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse; + + /** + * Creates a plain object from a ListAccountTaxResponse message. Also converts values to other types if specified. + * @param message ListAccountTaxResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAccountTaxResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAccountTaxResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TaxRule. */ + interface ITaxRule { + + /** TaxRule locationId */ + locationId?: (number|Long|string|null); + + /** TaxRule postCodeRange */ + postCodeRange?: (google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange|null); + + /** TaxRule useGoogleRate */ + useGoogleRate?: (boolean|null); + + /** TaxRule selfSpecifiedRateMicros */ + selfSpecifiedRateMicros?: (number|Long|string|null); + + /** TaxRule regionCode */ + regionCode?: (string|null); + + /** TaxRule shippingTaxed */ + shippingTaxed?: (boolean|null); + + /** TaxRule effectiveTimePeriod */ + effectiveTimePeriod?: (google.type.IInterval|null); + } + + /** Represents a TaxRule. */ + class TaxRule implements ITaxRule { + + /** + * Constructs a new TaxRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ITaxRule); + + /** TaxRule locationId. */ + public locationId?: (number|Long|string|null); + + /** TaxRule postCodeRange. */ + public postCodeRange?: (google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange|null); + + /** TaxRule useGoogleRate. */ + public useGoogleRate?: (boolean|null); + + /** TaxRule selfSpecifiedRateMicros. */ + public selfSpecifiedRateMicros?: (number|Long|string|null); + + /** TaxRule regionCode. */ + public regionCode: string; + + /** TaxRule shippingTaxed. */ + public shippingTaxed: boolean; + + /** TaxRule effectiveTimePeriod. */ + public effectiveTimePeriod?: (google.type.IInterval|null); + + /** TaxRule location. */ + public location?: ("locationId"|"postCodeRange"); + + /** TaxRule rateCalculation. */ + public rateCalculation?: ("useGoogleRate"|"selfSpecifiedRateMicros"); + + /** + * Creates a new TaxRule instance using the specified properties. + * @param [properties] Properties to set + * @returns TaxRule instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ITaxRule): google.shopping.merchant.accounts.v1beta.TaxRule; + + /** + * Encodes the specified TaxRule message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.verify|verify} messages. + * @param message TaxRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ITaxRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaxRule message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.verify|verify} messages. + * @param message TaxRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITaxRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaxRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaxRule + * @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.TaxRule; + + /** + * Decodes a TaxRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaxRule + * @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.TaxRule; + + /** + * Verifies a TaxRule 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 TaxRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaxRule + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TaxRule; + + /** + * Creates a plain object from a TaxRule message. Also converts values to other types if specified. + * @param message TaxRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.TaxRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaxRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaxRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TaxRule { + + /** Properties of a TaxPostalCodeRange. */ + interface ITaxPostalCodeRange { + + /** TaxPostalCodeRange start */ + start?: (string|null); + + /** TaxPostalCodeRange end */ + end?: (string|null); + } + + /** Represents a TaxPostalCodeRange. */ + class TaxPostalCodeRange implements ITaxPostalCodeRange { + + /** + * Constructs a new TaxPostalCodeRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange); + + /** TaxPostalCodeRange start. */ + public start: string; + + /** TaxPostalCodeRange end. */ + public end: string; + + /** + * Creates a new TaxPostalCodeRange instance using the specified properties. + * @param [properties] Properties to set + * @returns TaxPostalCodeRange instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange): google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange; + + /** + * Encodes the specified TaxPostalCodeRange message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify|verify} messages. + * @param message TaxPostalCodeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TaxPostalCodeRange message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify|verify} messages. + * @param message TaxPostalCodeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TaxPostalCodeRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TaxPostalCodeRange + * @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.TaxRule.TaxPostalCodeRange; + + /** + * Decodes a TaxPostalCodeRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TaxPostalCodeRange + * @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.TaxRule.TaxPostalCodeRange; + + /** + * Verifies a TaxPostalCodeRange 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 TaxPostalCodeRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TaxPostalCodeRange + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange; + + /** + * Creates a plain object from a TaxPostalCodeRange message. Also converts values to other types if specified. + * @param message TaxPostalCodeRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TaxPostalCodeRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TaxPostalCodeRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents an AccountIssueService */ + class AccountIssueService extends $protobuf.rpc.Service { + + /** + * Constructs a new AccountIssueService 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 AccountIssueService 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): AccountIssueService; + + /** + * Calls ListAccountIssues. + * @param request ListAccountIssuesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAccountIssuesResponse + */ + public listAccountIssues(request: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, callback: google.shopping.merchant.accounts.v1beta.AccountIssueService.ListAccountIssuesCallback): void; + + /** + * Calls ListAccountIssues. + * @param request ListAccountIssuesRequest message or plain object + * @returns Promise + */ + public listAccountIssues(request: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest): Promise; + } + + namespace AccountIssueService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountIssueService|listAccountIssues}. + * @param error Error, if any + * @param [response] ListAccountIssuesResponse + */ + type ListAccountIssuesCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse) => void; + } + + /** Properties of an AccountIssue. */ + interface IAccountIssue { + + /** AccountIssue name */ + name?: (string|null); + + /** AccountIssue title */ + title?: (string|null); + + /** AccountIssue severity */ + severity?: (google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|keyof typeof google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|null); + + /** AccountIssue impactedDestinations */ + impactedDestinations?: (google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination[]|null); + + /** AccountIssue detail */ + detail?: (string|null); + + /** AccountIssue documentationUri */ + documentationUri?: (string|null); + } + + /** Represents an AccountIssue. */ + class AccountIssue implements IAccountIssue { + + /** + * Constructs a new AccountIssue. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IAccountIssue); + + /** AccountIssue name. */ + public name: string; + + /** AccountIssue title. */ + public title: string; + + /** AccountIssue severity. */ + public severity: (google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|keyof typeof google.shopping.merchant.accounts.v1beta.AccountIssue.Severity); + + /** AccountIssue impactedDestinations. */ + public impactedDestinations: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination[]; + + /** AccountIssue detail. */ + public detail: string; + + /** AccountIssue documentationUri. */ + public documentationUri: string; + + /** + * Creates a new AccountIssue instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountIssue instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IAccountIssue): google.shopping.merchant.accounts.v1beta.AccountIssue; + + /** + * Encodes the specified AccountIssue message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.verify|verify} messages. + * @param message AccountIssue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IAccountIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccountIssue message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.verify|verify} messages. + * @param message AccountIssue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAccountIssue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountIssue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccountIssue + * @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.AccountIssue; + + /** + * Decodes an AccountIssue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccountIssue + * @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.AccountIssue; + + /** + * Verifies an AccountIssue 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 AccountIssue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccountIssue + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AccountIssue; + + /** + * Creates a plain object from an AccountIssue message. Also converts values to other types if specified. + * @param message AccountIssue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.AccountIssue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccountIssue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccountIssue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccountIssue { + + /** Properties of an ImpactedDestination. */ + interface IImpactedDestination { + + /** ImpactedDestination reportingContext */ + reportingContext?: (google.shopping.type.ReportingContext.ReportingContextEnum|keyof typeof google.shopping.type.ReportingContext.ReportingContextEnum|null); + + /** ImpactedDestination impacts */ + impacts?: (google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact[]|null); + } + + /** Represents an ImpactedDestination. */ + class ImpactedDestination implements IImpactedDestination { + + /** + * Constructs a new ImpactedDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination); + + /** ImpactedDestination reportingContext. */ + public reportingContext?: (google.shopping.type.ReportingContext.ReportingContextEnum|keyof typeof google.shopping.type.ReportingContext.ReportingContextEnum|null); + + /** ImpactedDestination impacts. */ + public impacts: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact[]; + + /** ImpactedDestination _reportingContext. */ + public _reportingContext?: "reportingContext"; + + /** + * Creates a new ImpactedDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns ImpactedDestination instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination): google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination; + + /** + * Encodes the specified ImpactedDestination message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify|verify} messages. + * @param message ImpactedDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImpactedDestination message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify|verify} messages. + * @param message ImpactedDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImpactedDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImpactedDestination + * @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.AccountIssue.ImpactedDestination; + + /** + * Decodes an ImpactedDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImpactedDestination + * @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.AccountIssue.ImpactedDestination; + + /** + * Verifies an ImpactedDestination 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 ImpactedDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImpactedDestination + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination; + + /** + * Creates a plain object from an ImpactedDestination message. Also converts values to other types if specified. + * @param message ImpactedDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImpactedDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImpactedDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImpactedDestination { + + /** Properties of an Impact. */ + interface IImpact { + + /** Impact regionCode */ + regionCode?: (string|null); + + /** Impact severity */ + severity?: (google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|keyof typeof google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|null); + } + + /** Represents an Impact. */ + class Impact implements IImpact { + + /** + * Constructs a new Impact. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact); + + /** Impact regionCode. */ + public regionCode: string; + + /** Impact severity. */ + public severity: (google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|keyof typeof google.shopping.merchant.accounts.v1beta.AccountIssue.Severity); + + /** + * Creates a new Impact instance using the specified properties. + * @param [properties] Properties to set + * @returns Impact instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact): google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact; + + /** + * Encodes the specified Impact message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify|verify} messages. + * @param message Impact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Impact message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify|verify} messages. + * @param message Impact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Impact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Impact + * @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.AccountIssue.ImpactedDestination.Impact; + + /** + * Decodes an Impact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Impact + * @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.AccountIssue.ImpactedDestination.Impact; + + /** + * Verifies an Impact 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 Impact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Impact + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact; + + /** + * Creates a plain object from an Impact message. Also converts values to other types if specified. + * @param message Impact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Impact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Impact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + CRITICAL = 1, + ERROR = 2, + SUGGESTION = 3 + } + } + + /** Properties of a ListAccountIssuesRequest. */ + interface IListAccountIssuesRequest { + + /** ListAccountIssuesRequest parent */ + parent?: (string|null); + + /** ListAccountIssuesRequest pageSize */ + pageSize?: (number|null); + + /** ListAccountIssuesRequest pageToken */ + pageToken?: (string|null); + + /** ListAccountIssuesRequest languageCode */ + languageCode?: (string|null); + + /** ListAccountIssuesRequest timeZone */ + timeZone?: (string|null); + } + + /** Represents a ListAccountIssuesRequest. */ + class ListAccountIssuesRequest implements IListAccountIssuesRequest { + + /** + * Constructs a new ListAccountIssuesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest); + + /** ListAccountIssuesRequest parent. */ + public parent: string; + + /** ListAccountIssuesRequest pageSize. */ + public pageSize: number; + + /** ListAccountIssuesRequest pageToken. */ + public pageToken: string; + + /** ListAccountIssuesRequest languageCode. */ + public languageCode: string; + + /** ListAccountIssuesRequest timeZone. */ + public timeZone: string; + + /** + * Creates a new ListAccountIssuesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAccountIssuesRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest): google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest; + + /** + * Encodes the specified ListAccountIssuesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest.verify|verify} messages. + * @param message ListAccountIssuesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAccountIssuesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest.verify|verify} messages. + * @param message ListAccountIssuesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAccountIssuesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAccountIssuesRequest + * @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.ListAccountIssuesRequest; + + /** + * Decodes a ListAccountIssuesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAccountIssuesRequest + * @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.ListAccountIssuesRequest; + + /** + * Verifies a ListAccountIssuesRequest 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 ListAccountIssuesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAccountIssuesRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest; + + /** + * Creates a plain object from a ListAccountIssuesRequest message. Also converts values to other types if specified. + * @param message ListAccountIssuesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAccountIssuesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAccountIssuesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAccountIssuesResponse. */ + interface IListAccountIssuesResponse { + + /** ListAccountIssuesResponse accountIssues */ + accountIssues?: (google.shopping.merchant.accounts.v1beta.IAccountIssue[]|null); + + /** ListAccountIssuesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAccountIssuesResponse. */ + class ListAccountIssuesResponse implements IListAccountIssuesResponse { + + /** + * Constructs a new ListAccountIssuesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse); + + /** ListAccountIssuesResponse accountIssues. */ + public accountIssues: google.shopping.merchant.accounts.v1beta.IAccountIssue[]; + + /** ListAccountIssuesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAccountIssuesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAccountIssuesResponse instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse): google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse; + + /** + * Encodes the specified ListAccountIssuesResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.verify|verify} messages. + * @param message ListAccountIssuesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAccountIssuesResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.verify|verify} messages. + * @param message ListAccountIssuesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAccountIssuesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAccountIssuesResponse + * @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.ListAccountIssuesResponse; + + /** + * Decodes a ListAccountIssuesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAccountIssuesResponse + * @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.ListAccountIssuesResponse; + + /** + * Verifies a ListAccountIssuesResponse 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 ListAccountIssuesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAccountIssuesResponse + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse; + + /** + * Creates a plain object from a ListAccountIssuesResponse message. Also converts values to other types if specified. + * @param message ListAccountIssuesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAccountIssuesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAccountIssuesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AccountsService */ + class AccountsService extends $protobuf.rpc.Service { + + /** + * Constructs a new AccountsService 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 AccountsService 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): AccountsService; + + /** + * Calls GetAccount. + * @param request GetAccountRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Account + */ + public getAccount(request: google.shopping.merchant.accounts.v1beta.IGetAccountRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.GetAccountCallback): void; + + /** + * Calls GetAccount. + * @param request GetAccountRequest message or plain object + * @returns Promise + */ + public getAccount(request: google.shopping.merchant.accounts.v1beta.IGetAccountRequest): Promise; + + /** + * Calls CreateAndConfigureAccount. + * @param request CreateAndConfigureAccountRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Account + */ + public createAndConfigureAccount(request: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.CreateAndConfigureAccountCallback): void; + + /** + * Calls CreateAndConfigureAccount. + * @param request CreateAndConfigureAccountRequest message or plain object + * @returns Promise + */ + public createAndConfigureAccount(request: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest): Promise; + + /** + * Calls DeleteAccount. + * @param request DeleteAccountRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAccount(request: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.DeleteAccountCallback): void; + + /** + * Calls DeleteAccount. + * @param request DeleteAccountRequest message or plain object + * @returns Promise + */ + public deleteAccount(request: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest): Promise; + + /** + * Calls UpdateAccount. + * @param request UpdateAccountRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Account + */ + public updateAccount(request: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.UpdateAccountCallback): void; + + /** + * Calls UpdateAccount. + * @param request UpdateAccountRequest message or plain object + * @returns Promise + */ + public updateAccount(request: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest): Promise; + + /** + * Calls ListAccounts. + * @param request ListAccountsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAccountsResponse + */ + public listAccounts(request: google.shopping.merchant.accounts.v1beta.IListAccountsRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.ListAccountsCallback): void; + + /** + * Calls ListAccounts. + * @param request ListAccountsRequest message or plain object + * @returns Promise + */ + public listAccounts(request: google.shopping.merchant.accounts.v1beta.IListAccountsRequest): Promise; + + /** + * Calls ListSubAccounts. + * @param request ListSubAccountsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSubAccountsResponse + */ + public listSubAccounts(request: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.ListSubAccountsCallback): void; + + /** + * Calls ListSubAccounts. + * @param request ListSubAccountsRequest message or plain object + * @returns Promise + */ + public listSubAccounts(request: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest): Promise; + } + + namespace AccountsService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|getAccount}. + * @param error Error, if any + * @param [response] Account + */ + type GetAccountCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Account) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|createAndConfigureAccount}. + * @param error Error, if any + * @param [response] Account + */ + type CreateAndConfigureAccountCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Account) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|deleteAccount}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAccountCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|updateAccount}. + * @param error Error, if any + * @param [response] Account + */ + type UpdateAccountCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Account) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|listAccounts}. + * @param error Error, if any + * @param [response] ListAccountsResponse + */ + type ListAccountsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListAccountsResponse) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|listSubAccounts}. + * @param error Error, if any + * @param [response] ListSubAccountsResponse + */ + type ListSubAccountsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse) => void; + } + + /** Properties of an Account. */ + interface IAccount { + + /** Account name */ + name?: (string|null); + + /** Account accountId */ + accountId?: (number|Long|string|null); + + /** Account accountName */ + accountName?: (string|null); + + /** Account adultContent */ + adultContent?: (boolean|null); + + /** Account testAccount */ + testAccount?: (boolean|null); + + /** Account timeZone */ + timeZone?: (google.type.ITimeZone|null); + + /** Account languageCode */ + languageCode?: (string|null); + } + + /** Represents an Account. */ + class Account implements IAccount { + + /** + * Constructs a new Account. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IAccount); + + /** Account name. */ + public name: string; + + /** Account accountId. */ + public accountId: (number|Long|string); + + /** Account accountName. */ + public accountName: string; + + /** Account adultContent. */ + public adultContent: boolean; + + /** Account testAccount. */ + public testAccount: boolean; + + /** Account timeZone. */ + public timeZone?: (google.type.ITimeZone|null); + + /** Account languageCode. */ + public languageCode: string; + + /** + * Creates a new Account instance using the specified properties. + * @param [properties] Properties to set + * @returns Account instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IAccount): google.shopping.merchant.accounts.v1beta.Account; + + /** + * Encodes the specified Account message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Account.verify|verify} messages. + * @param message Account message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Account message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Account.verify|verify} messages. + * @param message Account message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Account message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Account + * @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.Account; + + /** + * Decodes an Account message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Account + * @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.Account; + + /** + * Verifies an Account 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 Account message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Account + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Account; + + /** + * Creates a plain object from an Account message. Also converts values to other types if specified. + * @param message Account + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Account, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Account to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Account + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAccountRequest. */ + interface IGetAccountRequest { + + /** GetAccountRequest name */ + name?: (string|null); + } + + /** Represents a GetAccountRequest. */ + class GetAccountRequest implements IGetAccountRequest { + + /** + * Constructs a new GetAccountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetAccountRequest); + + /** GetAccountRequest name. */ + public name: string; + + /** + * Creates a new GetAccountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAccountRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetAccountRequest): google.shopping.merchant.accounts.v1beta.GetAccountRequest; + + /** + * Encodes the specified GetAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountRequest.verify|verify} messages. + * @param message GetAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountRequest.verify|verify} messages. + * @param message GetAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAccountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAccountRequest + * @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.GetAccountRequest; + + /** + * Decodes a GetAccountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAccountRequest + * @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.GetAccountRequest; + + /** + * Verifies a GetAccountRequest 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 GetAccountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAccountRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetAccountRequest; + + /** + * Creates a plain object from a GetAccountRequest message. Also converts values to other types if specified. + * @param message GetAccountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAccountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAccountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAndConfigureAccountRequest. */ + interface ICreateAndConfigureAccountRequest { + + /** CreateAndConfigureAccountRequest account */ + account?: (google.shopping.merchant.accounts.v1beta.IAccount|null); + + /** CreateAndConfigureAccountRequest users */ + users?: (google.shopping.merchant.accounts.v1beta.ICreateUserRequest[]|null); + + /** CreateAndConfigureAccountRequest acceptTermsOfService */ + acceptTermsOfService?: (google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService|null); + + /** CreateAndConfigureAccountRequest service */ + service?: (google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService[]|null); + } + + /** Represents a CreateAndConfigureAccountRequest. */ + class CreateAndConfigureAccountRequest implements ICreateAndConfigureAccountRequest { + + /** + * Constructs a new CreateAndConfigureAccountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest); + + /** CreateAndConfigureAccountRequest account. */ + public account?: (google.shopping.merchant.accounts.v1beta.IAccount|null); + + /** CreateAndConfigureAccountRequest users. */ + public users: google.shopping.merchant.accounts.v1beta.ICreateUserRequest[]; + + /** CreateAndConfigureAccountRequest acceptTermsOfService. */ + public acceptTermsOfService?: (google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService|null); + + /** CreateAndConfigureAccountRequest service. */ + public service: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService[]; + + /** CreateAndConfigureAccountRequest _acceptTermsOfService. */ + public _acceptTermsOfService?: "acceptTermsOfService"; + + /** + * Creates a new CreateAndConfigureAccountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAndConfigureAccountRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest; + + /** + * Encodes the specified CreateAndConfigureAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.verify|verify} messages. + * @param message CreateAndConfigureAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAndConfigureAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.verify|verify} messages. + * @param message CreateAndConfigureAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAndConfigureAccountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAndConfigureAccountRequest + * @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.CreateAndConfigureAccountRequest; + + /** + * Decodes a CreateAndConfigureAccountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAndConfigureAccountRequest + * @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.CreateAndConfigureAccountRequest; + + /** + * Verifies a CreateAndConfigureAccountRequest 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 CreateAndConfigureAccountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAndConfigureAccountRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest; + + /** + * Creates a plain object from a CreateAndConfigureAccountRequest message. Also converts values to other types if specified. + * @param message CreateAndConfigureAccountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAndConfigureAccountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAndConfigureAccountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CreateAndConfigureAccountRequest { + + /** Properties of an AcceptTermsOfService. */ + interface IAcceptTermsOfService { + + /** AcceptTermsOfService name */ + name?: (string|null); + + /** AcceptTermsOfService regionCode */ + regionCode?: (string|null); + } + + /** Represents an AcceptTermsOfService. */ + class AcceptTermsOfService implements IAcceptTermsOfService { + + /** + * Constructs a new AcceptTermsOfService. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService); + + /** AcceptTermsOfService name. */ + public name: string; + + /** AcceptTermsOfService regionCode. */ + public regionCode: string; + + /** + * Creates a new AcceptTermsOfService instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceptTermsOfService instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService; + + /** + * Encodes the specified AcceptTermsOfService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify|verify} messages. + * @param message AcceptTermsOfService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceptTermsOfService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify|verify} messages. + * @param message AcceptTermsOfService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceptTermsOfService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceptTermsOfService + * @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.CreateAndConfigureAccountRequest.AcceptTermsOfService; + + /** + * Decodes an AcceptTermsOfService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceptTermsOfService + * @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.CreateAndConfigureAccountRequest.AcceptTermsOfService; + + /** + * Verifies an AcceptTermsOfService 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 AcceptTermsOfService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceptTermsOfService + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService; + + /** + * Creates a plain object from an AcceptTermsOfService message. Also converts values to other types if specified. + * @param message AcceptTermsOfService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceptTermsOfService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcceptTermsOfService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddAccountService. */ + interface IAddAccountService { + + /** AddAccountService accountAggregation */ + accountAggregation?: (google.shopping.merchant.accounts.v1beta.IAccountAggregation|null); + + /** AddAccountService provider */ + provider?: (string|null); + } + + /** Represents an AddAccountService. */ + class AddAccountService implements IAddAccountService { + + /** + * Constructs a new AddAccountService. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService); + + /** AddAccountService accountAggregation. */ + public accountAggregation?: (google.shopping.merchant.accounts.v1beta.IAccountAggregation|null); + + /** AddAccountService provider. */ + public provider?: (string|null); + + /** AddAccountService serviceType. */ + public serviceType?: "accountAggregation"; + + /** AddAccountService _provider. */ + public _provider?: "provider"; + + /** + * Creates a new AddAccountService instance using the specified properties. + * @param [properties] Properties to set + * @returns AddAccountService instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService; + + /** + * Encodes the specified AddAccountService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify|verify} messages. + * @param message AddAccountService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddAccountService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify|verify} messages. + * @param message AddAccountService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddAccountService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddAccountService + * @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.CreateAndConfigureAccountRequest.AddAccountService; + + /** + * Decodes an AddAccountService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddAccountService + * @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.CreateAndConfigureAccountRequest.AddAccountService; + + /** + * Verifies an AddAccountService 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 AddAccountService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddAccountService + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService; + + /** + * Creates a plain object from an AddAccountService message. Also converts values to other types if specified. + * @param message AddAccountService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddAccountService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddAccountService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DeleteAccountRequest. */ + interface IDeleteAccountRequest { + + /** DeleteAccountRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAccountRequest. */ + class DeleteAccountRequest implements IDeleteAccountRequest { + + /** + * Constructs a new DeleteAccountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest); + + /** DeleteAccountRequest name. */ + public name: string; + + /** + * Creates a new DeleteAccountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAccountRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest): google.shopping.merchant.accounts.v1beta.DeleteAccountRequest; + + /** + * Encodes the specified DeleteAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteAccountRequest.verify|verify} messages. + * @param message DeleteAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteAccountRequest.verify|verify} messages. + * @param message DeleteAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAccountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAccountRequest + * @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.DeleteAccountRequest; + + /** + * Decodes a DeleteAccountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAccountRequest + * @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.DeleteAccountRequest; + + /** + * Verifies a DeleteAccountRequest 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 DeleteAccountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAccountRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DeleteAccountRequest; + + /** + * Creates a plain object from a DeleteAccountRequest message. Also converts values to other types if specified. + * @param message DeleteAccountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.DeleteAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAccountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAccountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAccountRequest. */ + interface IUpdateAccountRequest { + + /** UpdateAccountRequest account */ + account?: (google.shopping.merchant.accounts.v1beta.IAccount|null); + + /** UpdateAccountRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAccountRequest. */ + class UpdateAccountRequest implements IUpdateAccountRequest { + + /** + * Constructs a new UpdateAccountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest); + + /** UpdateAccountRequest account. */ + public account?: (google.shopping.merchant.accounts.v1beta.IAccount|null); + + /** UpdateAccountRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAccountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAccountRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest): google.shopping.merchant.accounts.v1beta.UpdateAccountRequest; + + /** + * Encodes the specified UpdateAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.verify|verify} messages. + * @param message UpdateAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.verify|verify} messages. + * @param message UpdateAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAccountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAccountRequest + * @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.UpdateAccountRequest; + + /** + * Decodes an UpdateAccountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAccountRequest + * @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.UpdateAccountRequest; + + /** + * Verifies an UpdateAccountRequest 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 UpdateAccountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAccountRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateAccountRequest; + + /** + * Creates a plain object from an UpdateAccountRequest message. Also converts values to other types if specified. + * @param message UpdateAccountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAccountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAccountRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAccountsRequest. */ + interface IListAccountsRequest { + + /** ListAccountsRequest pageSize */ + pageSize?: (number|null); + + /** ListAccountsRequest pageToken */ + pageToken?: (string|null); + + /** ListAccountsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListAccountsRequest. */ + class ListAccountsRequest implements IListAccountsRequest { + + /** + * Constructs a new ListAccountsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountsRequest); + + /** ListAccountsRequest pageSize. */ + public pageSize: number; + + /** ListAccountsRequest pageToken. */ + public pageToken: string; + + /** ListAccountsRequest filter. */ + public filter: string; + + /** + * Creates a new ListAccountsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAccountsRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountsRequest): google.shopping.merchant.accounts.v1beta.ListAccountsRequest; + + /** + * Encodes the specified ListAccountsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsRequest.verify|verify} messages. + * @param message ListAccountsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAccountsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsRequest.verify|verify} messages. + * @param message ListAccountsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAccountsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAccountsRequest + * @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.ListAccountsRequest; + + /** + * Decodes a ListAccountsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAccountsRequest + * @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.ListAccountsRequest; + + /** + * Verifies a ListAccountsRequest 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 ListAccountsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAccountsRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountsRequest; + + /** + * Creates a plain object from a ListAccountsRequest message. Also converts values to other types if specified. + * @param message ListAccountsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAccountsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAccountsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAccountsResponse. */ + interface IListAccountsResponse { + + /** ListAccountsResponse accounts */ + accounts?: (google.shopping.merchant.accounts.v1beta.IAccount[]|null); + + /** ListAccountsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAccountsResponse. */ + class ListAccountsResponse implements IListAccountsResponse { + + /** + * Constructs a new ListAccountsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountsResponse); + + /** ListAccountsResponse accounts. */ + public accounts: google.shopping.merchant.accounts.v1beta.IAccount[]; + + /** ListAccountsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAccountsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAccountsResponse instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountsResponse): google.shopping.merchant.accounts.v1beta.ListAccountsResponse; + + /** + * Encodes the specified ListAccountsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsResponse.verify|verify} messages. + * @param message ListAccountsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAccountsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsResponse.verify|verify} messages. + * @param message ListAccountsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAccountsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAccountsResponse + * @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.ListAccountsResponse; + + /** + * Decodes a ListAccountsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAccountsResponse + * @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.ListAccountsResponse; + + /** + * Verifies a ListAccountsResponse 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 ListAccountsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAccountsResponse + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountsResponse; + + /** + * Creates a plain object from a ListAccountsResponse message. Also converts values to other types if specified. + * @param message ListAccountsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAccountsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAccountsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSubAccountsRequest. */ + interface IListSubAccountsRequest { + + /** ListSubAccountsRequest provider */ + provider?: (string|null); + + /** ListSubAccountsRequest pageSize */ + pageSize?: (number|null); + + /** ListSubAccountsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSubAccountsRequest. */ + class ListSubAccountsRequest implements IListSubAccountsRequest { + + /** + * Constructs a new ListSubAccountsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest); + + /** ListSubAccountsRequest provider. */ + public provider: string; + + /** ListSubAccountsRequest pageSize. */ + public pageSize: number; + + /** ListSubAccountsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSubAccountsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubAccountsRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest): google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest; + + /** + * Encodes the specified ListSubAccountsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest.verify|verify} messages. + * @param message ListSubAccountsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubAccountsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest.verify|verify} messages. + * @param message ListSubAccountsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubAccountsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubAccountsRequest + * @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.ListSubAccountsRequest; + + /** + * Decodes a ListSubAccountsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubAccountsRequest + * @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.ListSubAccountsRequest; + + /** + * Verifies a ListSubAccountsRequest 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 ListSubAccountsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubAccountsRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest; + + /** + * Creates a plain object from a ListSubAccountsRequest message. Also converts values to other types if specified. + * @param message ListSubAccountsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubAccountsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubAccountsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSubAccountsResponse. */ + interface IListSubAccountsResponse { + + /** ListSubAccountsResponse accounts */ + accounts?: (google.shopping.merchant.accounts.v1beta.IAccount[]|null); + + /** ListSubAccountsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSubAccountsResponse. */ + class ListSubAccountsResponse implements IListSubAccountsResponse { + + /** + * Constructs a new ListSubAccountsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse); + + /** ListSubAccountsResponse accounts. */ + public accounts: google.shopping.merchant.accounts.v1beta.IAccount[]; + + /** ListSubAccountsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSubAccountsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubAccountsResponse instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse): google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse; + + /** + * Encodes the specified ListSubAccountsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.verify|verify} messages. + * @param message ListSubAccountsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubAccountsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.verify|verify} messages. + * @param message ListSubAccountsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubAccountsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubAccountsResponse + * @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.ListSubAccountsResponse; + + /** + * Decodes a ListSubAccountsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubAccountsResponse + * @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.ListSubAccountsResponse; + + /** + * Verifies a ListSubAccountsResponse 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 ListSubAccountsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubAccountsResponse + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse; + + /** + * Creates a plain object from a ListSubAccountsResponse message. Also converts values to other types if specified. + * @param message ListSubAccountsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubAccountsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubAccountsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + 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 { + + /** + * Constructs a new UserService 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 UserService 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): UserService; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public getUser(request: google.shopping.merchant.accounts.v1beta.IGetUserRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.GetUserCallback): void; + + /** + * Calls GetUser. + * @param request GetUserRequest message or plain object + * @returns Promise + */ + public getUser(request: google.shopping.merchant.accounts.v1beta.IGetUserRequest): Promise; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public createUser(request: google.shopping.merchant.accounts.v1beta.ICreateUserRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.CreateUserCallback): void; + + /** + * Calls CreateUser. + * @param request CreateUserRequest message or plain object + * @returns Promise + */ + public createUser(request: google.shopping.merchant.accounts.v1beta.ICreateUserRequest): Promise; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteUser(request: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.DeleteUserCallback): void; + + /** + * Calls DeleteUser. + * @param request DeleteUserRequest message or plain object + * @returns Promise + */ + public deleteUser(request: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest): Promise; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @param callback Node-style callback called with the error, if any, and User + */ + public updateUser(request: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.UpdateUserCallback): void; + + /** + * Calls UpdateUser. + * @param request UpdateUserRequest message or plain object + * @returns Promise + */ + public updateUser(request: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest): Promise; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUsersResponse + */ + public listUsers(request: google.shopping.merchant.accounts.v1beta.IListUsersRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.ListUsersCallback): void; + + /** + * Calls ListUsers. + * @param request ListUsersRequest message or plain object + * @returns Promise + */ + public listUsers(request: google.shopping.merchant.accounts.v1beta.IListUsersRequest): Promise; + } + + namespace UserService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|getUser}. + * @param error Error, if any + * @param [response] User + */ + type GetUserCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.User) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|createUser}. + * @param error Error, if any + * @param [response] User + */ + type CreateUserCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.User) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|deleteUser}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|updateUser}. + * @param error Error, if any + * @param [response] User + */ + type UpdateUserCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.User) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|listUsers}. + * @param error Error, if any + * @param [response] ListUsersResponse + */ + type ListUsersCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListUsersResponse) => void; + } + + /** Properties of a User. */ + interface IUser { + + /** User name */ + name?: (string|null); + + /** User state */ + state?: (google.shopping.merchant.accounts.v1beta.User.State|keyof typeof google.shopping.merchant.accounts.v1beta.User.State|null); + + /** User accessRights */ + accessRights?: (google.shopping.merchant.accounts.v1beta.AccessRight[]|null); + } + + /** Represents a User. */ + class User implements IUser { + + /** + * Constructs a new User. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUser); + + /** User name. */ + public name: string; + + /** User state. */ + public state: (google.shopping.merchant.accounts.v1beta.User.State|keyof typeof google.shopping.merchant.accounts.v1beta.User.State); + + /** User accessRights. */ + public accessRights: google.shopping.merchant.accounts.v1beta.AccessRight[]; + + /** + * Creates a new User instance using the specified properties. + * @param [properties] Properties to set + * @returns User instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUser): google.shopping.merchant.accounts.v1beta.User; + + /** + * Encodes the specified User message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.User.verify|verify} messages. + * @param message User message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a User message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns User + * @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.User; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns User + * @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.User; + + /** + * Verifies a User 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 User message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns User + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.User; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this User to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for User + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace User { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + VERIFIED = 2 + } + } + + /** Properties of a GetUserRequest. */ + interface IGetUserRequest { + + /** GetUserRequest name */ + name?: (string|null); + } + + /** Represents a GetUserRequest. */ + class GetUserRequest implements IGetUserRequest { + + /** + * Constructs a new GetUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetUserRequest); + + /** GetUserRequest name. */ + public name: string; + + /** + * Creates a new GetUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUserRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetUserRequest): google.shopping.merchant.accounts.v1beta.GetUserRequest; + + /** + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetUserRequest.verify|verify} messages. + * @param message GetUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUserRequest + * @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.GetUserRequest; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUserRequest + * @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.GetUserRequest; + + /** + * Verifies a GetUserRequest 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 GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetUserRequest; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @param message GetUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateUserRequest. */ + interface ICreateUserRequest { + + /** CreateUserRequest parent */ + parent?: (string|null); + + /** CreateUserRequest userId */ + userId?: (string|null); + + /** CreateUserRequest user */ + user?: (google.shopping.merchant.accounts.v1beta.IUser|null); + } + + /** Represents a CreateUserRequest. */ + class CreateUserRequest implements ICreateUserRequest { + + /** + * Constructs a new CreateUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ICreateUserRequest); + + /** CreateUserRequest parent. */ + public parent: string; + + /** CreateUserRequest userId. */ + public userId: string; + + /** CreateUserRequest user. */ + public user?: (google.shopping.merchant.accounts.v1beta.IUser|null); + + /** + * Creates a new CreateUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUserRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ICreateUserRequest): google.shopping.merchant.accounts.v1beta.CreateUserRequest; + + /** + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify|verify} messages. + * @param message CreateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUserRequest + * @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.CreateUserRequest; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUserRequest + * @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.CreateUserRequest; + + /** + * Verifies a CreateUserRequest 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 CreateUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateUserRequest; + + /** + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @param message CreateUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteUserRequest. */ + interface IDeleteUserRequest { + + /** DeleteUserRequest name */ + name?: (string|null); + } + + /** Represents a DeleteUserRequest. */ + class DeleteUserRequest implements IDeleteUserRequest { + + /** + * Constructs a new DeleteUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest); + + /** DeleteUserRequest name. */ + public name: string; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUserRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest): google.shopping.merchant.accounts.v1beta.DeleteUserRequest; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteUserRequest.verify|verify} messages. + * @param message DeleteUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUserRequest + * @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.DeleteUserRequest; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUserRequest + * @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.DeleteUserRequest; + + /** + * Verifies a DeleteUserRequest 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 DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DeleteUserRequest; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @param message DeleteUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateUserRequest. */ + interface IUpdateUserRequest { + + /** UpdateUserRequest user */ + user?: (google.shopping.merchant.accounts.v1beta.IUser|null); + + /** UpdateUserRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateUserRequest. */ + class UpdateUserRequest implements IUpdateUserRequest { + + /** + * Constructs a new UpdateUserRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest); + + /** UpdateUserRequest user. */ + public user?: (google.shopping.merchant.accounts.v1beta.IUser|null); + + /** UpdateUserRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUserRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest): google.shopping.merchant.accounts.v1beta.UpdateUserRequest; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateUserRequest.verify|verify} messages. + * @param message UpdateUserRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUserRequest + * @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.UpdateUserRequest; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUserRequest + * @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.UpdateUserRequest; + + /** + * Verifies an UpdateUserRequest 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 UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUserRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateUserRequest; + + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @param message UpdateUserRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUserRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUserRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUsersRequest. */ + interface IListUsersRequest { + + /** ListUsersRequest parent */ + parent?: (string|null); + + /** ListUsersRequest pageSize */ + pageSize?: (number|null); + + /** ListUsersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListUsersRequest. */ + class ListUsersRequest implements IListUsersRequest { + + /** + * Constructs a new ListUsersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListUsersRequest); + + /** ListUsersRequest parent. */ + public parent: string; + + /** ListUsersRequest pageSize. */ + public pageSize: number; + + /** ListUsersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListUsersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsersRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListUsersRequest): google.shopping.merchant.accounts.v1beta.ListUsersRequest; + + /** + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersRequest.verify|verify} messages. + * @param message ListUsersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsersRequest + * @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.ListUsersRequest; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsersRequest + * @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.ListUsersRequest; + + /** + * Verifies a ListUsersRequest 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 ListUsersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsersRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListUsersRequest; + + /** + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @param message ListUsersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUsersResponse. */ + interface IListUsersResponse { + + /** ListUsersResponse users */ + users?: (google.shopping.merchant.accounts.v1beta.IUser[]|null); + + /** ListUsersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListUsersResponse. */ + class ListUsersResponse implements IListUsersResponse { + + /** + * Constructs a new ListUsersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListUsersResponse); + + /** ListUsersResponse users. */ + public users: google.shopping.merchant.accounts.v1beta.IUser[]; + + /** ListUsersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListUsersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsersResponse instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListUsersResponse): google.shopping.merchant.accounts.v1beta.ListUsersResponse; + + /** + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersResponse.verify|verify} messages. + * @param message ListUsersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsersResponse + * @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.ListUsersResponse; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsersResponse + * @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.ListUsersResponse; + + /** + * Verifies a ListUsersResponse 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 ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsersResponse + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListUsersResponse; + + /** + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @param message ListUsersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + 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 { + + /** + * Constructs a new BusinessIdentityService 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 BusinessIdentityService 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): BusinessIdentityService; + + /** + * Calls GetBusinessIdentity. + * @param request GetBusinessIdentityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BusinessIdentity + */ + public getBusinessIdentity(request: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, callback: google.shopping.merchant.accounts.v1beta.BusinessIdentityService.GetBusinessIdentityCallback): void; + + /** + * Calls GetBusinessIdentity. + * @param request GetBusinessIdentityRequest message or plain object + * @returns Promise + */ + public getBusinessIdentity(request: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest): Promise; + + /** + * Calls UpdateBusinessIdentity. + * @param request UpdateBusinessIdentityRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BusinessIdentity + */ + public updateBusinessIdentity(request: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, callback: google.shopping.merchant.accounts.v1beta.BusinessIdentityService.UpdateBusinessIdentityCallback): void; + + /** + * Calls UpdateBusinessIdentity. + * @param request UpdateBusinessIdentityRequest message or plain object + * @returns Promise + */ + public updateBusinessIdentity(request: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest): Promise; + } + + namespace BusinessIdentityService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessIdentityService|getBusinessIdentity}. + * @param error Error, if any + * @param [response] BusinessIdentity + */ + type GetBusinessIdentityCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.BusinessIdentity) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessIdentityService|updateBusinessIdentity}. + * @param error Error, if any + * @param [response] BusinessIdentity + */ + type UpdateBusinessIdentityCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.BusinessIdentity) => void; + } + + /** Properties of a BusinessIdentity. */ + interface IBusinessIdentity { + + /** BusinessIdentity name */ + name?: (string|null); + + /** BusinessIdentity promotionsConsent */ + promotionsConsent?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent|keyof typeof google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent|null); + + /** BusinessIdentity blackOwned */ + blackOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + + /** BusinessIdentity womenOwned */ + womenOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + + /** BusinessIdentity veteranOwned */ + veteranOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + + /** BusinessIdentity latinoOwned */ + latinoOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + + /** BusinessIdentity smallBusiness */ + smallBusiness?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + } + + /** Represents a BusinessIdentity. */ + class BusinessIdentity implements IBusinessIdentity { + + /** + * Constructs a new BusinessIdentity. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IBusinessIdentity); + + /** BusinessIdentity name. */ + public name: string; + + /** BusinessIdentity promotionsConsent. */ + public promotionsConsent: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent|keyof typeof google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent); + + /** BusinessIdentity blackOwned. */ + public blackOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + + /** BusinessIdentity womenOwned. */ + public womenOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + + /** BusinessIdentity veteranOwned. */ + public veteranOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + + /** BusinessIdentity latinoOwned. */ + public latinoOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + + /** BusinessIdentity smallBusiness. */ + public smallBusiness?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); + + /** + * Creates a new BusinessIdentity instance using the specified properties. + * @param [properties] Properties to set + * @returns BusinessIdentity instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IBusinessIdentity): google.shopping.merchant.accounts.v1beta.BusinessIdentity; + + /** + * Encodes the specified BusinessIdentity message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify|verify} messages. + * @param message BusinessIdentity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IBusinessIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BusinessIdentity message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify|verify} messages. + * @param message BusinessIdentity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IBusinessIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BusinessIdentity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BusinessIdentity + * @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.BusinessIdentity; + + /** + * Decodes a BusinessIdentity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BusinessIdentity + * @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.BusinessIdentity; + + /** + * Verifies a BusinessIdentity 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 BusinessIdentity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BusinessIdentity + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.BusinessIdentity; + + /** + * Creates a plain object from a BusinessIdentity message. Also converts values to other types if specified. + * @param message BusinessIdentity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.BusinessIdentity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BusinessIdentity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BusinessIdentity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BusinessIdentity { + + /** Properties of an IdentityAttribute. */ + interface IIdentityAttribute { + + /** IdentityAttribute identityDeclaration */ + identityDeclaration?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration|keyof typeof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration|null); + } + + /** Represents an IdentityAttribute. */ + class IdentityAttribute implements IIdentityAttribute { + + /** + * Constructs a new IdentityAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute); + + /** IdentityAttribute identityDeclaration. */ + public identityDeclaration: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration|keyof typeof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration); + + /** + * Creates a new IdentityAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentityAttribute instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute): google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute; + + /** + * Encodes the specified IdentityAttribute message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify|verify} messages. + * @param message IdentityAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentityAttribute message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify|verify} messages. + * @param message IdentityAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentityAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentityAttribute + * @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.BusinessIdentity.IdentityAttribute; + + /** + * Decodes an IdentityAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentityAttribute + * @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.BusinessIdentity.IdentityAttribute; + + /** + * Verifies an IdentityAttribute 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 IdentityAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentityAttribute + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute; + + /** + * Creates a plain object from an IdentityAttribute message. Also converts values to other types if specified. + * @param message IdentityAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentityAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentityAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IdentityAttribute { + + /** IdentityDeclaration enum. */ + enum IdentityDeclaration { + IDENTITY_DECLARATION_UNSPECIFIED = 0, + SELF_IDENTIFIES_AS = 1, + DOES_NOT_SELF_IDENTIFY_AS = 2 + } + } + + /** PromotionsConsent enum. */ + enum PromotionsConsent { + PROMOTIONS_CONSENT_UNSPECIFIED = 0, + PROMOTIONS_CONSENT_GIVEN = 1, + PROMOTIONS_CONSENT_DENIED = 2 + } + } + + /** Properties of a GetBusinessIdentityRequest. */ + interface IGetBusinessIdentityRequest { + + /** GetBusinessIdentityRequest name */ + name?: (string|null); + } + + /** Represents a GetBusinessIdentityRequest. */ + class GetBusinessIdentityRequest implements IGetBusinessIdentityRequest { + + /** + * Constructs a new GetBusinessIdentityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest); + + /** GetBusinessIdentityRequest name. */ + public name: string; + + /** + * Creates a new GetBusinessIdentityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBusinessIdentityRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest): google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest; + + /** + * Encodes the specified GetBusinessIdentityRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest.verify|verify} messages. + * @param message GetBusinessIdentityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBusinessIdentityRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest.verify|verify} messages. + * @param message GetBusinessIdentityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBusinessIdentityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBusinessIdentityRequest + * @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.GetBusinessIdentityRequest; + + /** + * Decodes a GetBusinessIdentityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBusinessIdentityRequest + * @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.GetBusinessIdentityRequest; + + /** + * Verifies a GetBusinessIdentityRequest 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 GetBusinessIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBusinessIdentityRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest; + + /** + * Creates a plain object from a GetBusinessIdentityRequest message. Also converts values to other types if specified. + * @param message GetBusinessIdentityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBusinessIdentityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBusinessIdentityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBusinessIdentityRequest. */ + interface IUpdateBusinessIdentityRequest { + + /** UpdateBusinessIdentityRequest businessIdentity */ + businessIdentity?: (google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null); + + /** UpdateBusinessIdentityRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBusinessIdentityRequest. */ + class UpdateBusinessIdentityRequest implements IUpdateBusinessIdentityRequest { + + /** + * Constructs a new UpdateBusinessIdentityRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest); + + /** UpdateBusinessIdentityRequest businessIdentity. */ + public businessIdentity?: (google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null); + + /** UpdateBusinessIdentityRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBusinessIdentityRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBusinessIdentityRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest): google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest; + + /** + * Encodes the specified UpdateBusinessIdentityRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.verify|verify} messages. + * @param message UpdateBusinessIdentityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBusinessIdentityRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.verify|verify} messages. + * @param message UpdateBusinessIdentityRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBusinessIdentityRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBusinessIdentityRequest + * @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.UpdateBusinessIdentityRequest; + + /** + * Decodes an UpdateBusinessIdentityRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBusinessIdentityRequest + * @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.UpdateBusinessIdentityRequest; + + /** + * Verifies an UpdateBusinessIdentityRequest 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 UpdateBusinessIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBusinessIdentityRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest; + + /** + * Creates a plain object from an UpdateBusinessIdentityRequest message. Also converts values to other types if specified. + * @param message UpdateBusinessIdentityRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBusinessIdentityRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBusinessIdentityRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a BusinessInfoService */ + class BusinessInfoService extends $protobuf.rpc.Service { + + /** + * Constructs a new BusinessInfoService 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 BusinessInfoService 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): BusinessInfoService; + + /** + * Calls GetBusinessInfo. + * @param request GetBusinessInfoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BusinessInfo + */ + public getBusinessInfo(request: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, callback: google.shopping.merchant.accounts.v1beta.BusinessInfoService.GetBusinessInfoCallback): void; + + /** + * Calls GetBusinessInfo. + * @param request GetBusinessInfoRequest message or plain object + * @returns Promise + */ + public getBusinessInfo(request: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest): Promise; + + /** + * Calls UpdateBusinessInfo. + * @param request UpdateBusinessInfoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BusinessInfo + */ + public updateBusinessInfo(request: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, callback: google.shopping.merchant.accounts.v1beta.BusinessInfoService.UpdateBusinessInfoCallback): void; + + /** + * Calls UpdateBusinessInfo. + * @param request UpdateBusinessInfoRequest message or plain object + * @returns Promise + */ + public updateBusinessInfo(request: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest): Promise; + } + + namespace BusinessInfoService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessInfoService|getBusinessInfo}. + * @param error Error, if any + * @param [response] BusinessInfo + */ + type GetBusinessInfoCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.BusinessInfo) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessInfoService|updateBusinessInfo}. + * @param error Error, if any + * @param [response] BusinessInfo + */ + type UpdateBusinessInfoCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.BusinessInfo) => void; + } + + /** Properties of a BusinessInfo. */ + interface IBusinessInfo { + + /** BusinessInfo name */ + name?: (string|null); + + /** BusinessInfo address */ + address?: (google.type.IPostalAddress|null); + + /** BusinessInfo phone */ + phone?: (google.type.IPhoneNumber|null); + + /** BusinessInfo phoneVerificationState */ + phoneVerificationState?: (google.shopping.merchant.accounts.v1beta.PhoneVerificationState|keyof typeof google.shopping.merchant.accounts.v1beta.PhoneVerificationState|null); + + /** BusinessInfo customerService */ + customerService?: (google.shopping.merchant.accounts.v1beta.ICustomerService|null); + + /** BusinessInfo koreanBusinessRegistrationNumber */ + koreanBusinessRegistrationNumber?: (string|null); + } + + /** Represents a BusinessInfo. */ + class BusinessInfo implements IBusinessInfo { + + /** + * Constructs a new BusinessInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IBusinessInfo); + + /** BusinessInfo name. */ + public name: string; + + /** BusinessInfo address. */ + public address?: (google.type.IPostalAddress|null); + + /** BusinessInfo phone. */ + public phone?: (google.type.IPhoneNumber|null); + + /** BusinessInfo phoneVerificationState. */ + public phoneVerificationState?: (google.shopping.merchant.accounts.v1beta.PhoneVerificationState|keyof typeof google.shopping.merchant.accounts.v1beta.PhoneVerificationState|null); + + /** BusinessInfo customerService. */ + public customerService?: (google.shopping.merchant.accounts.v1beta.ICustomerService|null); + + /** BusinessInfo koreanBusinessRegistrationNumber. */ + public koreanBusinessRegistrationNumber?: (string|null); + + /** BusinessInfo _address. */ + public _address?: "address"; + + /** BusinessInfo _phone. */ + public _phone?: "phone"; + + /** BusinessInfo _phoneVerificationState. */ + public _phoneVerificationState?: "phoneVerificationState"; + + /** BusinessInfo _customerService. */ + public _customerService?: "customerService"; + + /** BusinessInfo _koreanBusinessRegistrationNumber. */ + public _koreanBusinessRegistrationNumber?: "koreanBusinessRegistrationNumber"; + + /** + * Creates a new BusinessInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BusinessInfo instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IBusinessInfo): google.shopping.merchant.accounts.v1beta.BusinessInfo; + + /** + * Encodes the specified BusinessInfo message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessInfo.verify|verify} messages. + * @param message BusinessInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IBusinessInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BusinessInfo message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessInfo.verify|verify} messages. + * @param message BusinessInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IBusinessInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BusinessInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BusinessInfo + * @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.BusinessInfo; + + /** + * Decodes a BusinessInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BusinessInfo + * @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.BusinessInfo; + + /** + * Verifies a BusinessInfo 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 BusinessInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BusinessInfo + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.BusinessInfo; + + /** + * Creates a plain object from a BusinessInfo message. Also converts values to other types if specified. + * @param message BusinessInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.BusinessInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BusinessInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BusinessInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBusinessInfoRequest. */ + interface IGetBusinessInfoRequest { + + /** GetBusinessInfoRequest name */ + name?: (string|null); + } + + /** Represents a GetBusinessInfoRequest. */ + class GetBusinessInfoRequest implements IGetBusinessInfoRequest { + + /** + * Constructs a new GetBusinessInfoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest); + + /** GetBusinessInfoRequest name. */ + public name: string; + + /** + * Creates a new GetBusinessInfoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBusinessInfoRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest): google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest; + + /** + * Encodes the specified GetBusinessInfoRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest.verify|verify} messages. + * @param message GetBusinessInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBusinessInfoRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest.verify|verify} messages. + * @param message GetBusinessInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBusinessInfoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBusinessInfoRequest + * @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.GetBusinessInfoRequest; + + /** + * Decodes a GetBusinessInfoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBusinessInfoRequest + * @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.GetBusinessInfoRequest; + + /** + * Verifies a GetBusinessInfoRequest 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 GetBusinessInfoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBusinessInfoRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest; + + /** + * Creates a plain object from a GetBusinessInfoRequest message. Also converts values to other types if specified. + * @param message GetBusinessInfoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBusinessInfoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBusinessInfoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBusinessInfoRequest. */ + interface IUpdateBusinessInfoRequest { + + /** UpdateBusinessInfoRequest businessInfo */ + businessInfo?: (google.shopping.merchant.accounts.v1beta.IBusinessInfo|null); + + /** UpdateBusinessInfoRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBusinessInfoRequest. */ + class UpdateBusinessInfoRequest implements IUpdateBusinessInfoRequest { + + /** + * Constructs a new UpdateBusinessInfoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest); + + /** UpdateBusinessInfoRequest businessInfo. */ + public businessInfo?: (google.shopping.merchant.accounts.v1beta.IBusinessInfo|null); + + /** UpdateBusinessInfoRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBusinessInfoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBusinessInfoRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest): google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest; + + /** + * Encodes the specified UpdateBusinessInfoRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.verify|verify} messages. + * @param message UpdateBusinessInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBusinessInfoRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.verify|verify} messages. + * @param message UpdateBusinessInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBusinessInfoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBusinessInfoRequest + * @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.UpdateBusinessInfoRequest; + + /** + * Decodes an UpdateBusinessInfoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBusinessInfoRequest + * @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.UpdateBusinessInfoRequest; + + /** + * Verifies an UpdateBusinessInfoRequest 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 UpdateBusinessInfoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBusinessInfoRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest; + + /** + * Creates a plain object from an UpdateBusinessInfoRequest message. Also converts values to other types if specified. + * @param message UpdateBusinessInfoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBusinessInfoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBusinessInfoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomerService. */ + interface ICustomerService { + + /** CustomerService uri */ + uri?: (string|null); + + /** CustomerService email */ + email?: (string|null); + + /** CustomerService phone */ + phone?: (google.type.IPhoneNumber|null); + } + + /** Represents a CustomerService. */ + class CustomerService implements ICustomerService { + + /** + * Constructs a new CustomerService. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ICustomerService); + + /** CustomerService uri. */ + public uri?: (string|null); + + /** CustomerService email. */ + public email?: (string|null); + + /** CustomerService phone. */ + public phone?: (google.type.IPhoneNumber|null); + + /** CustomerService _uri. */ + public _uri?: "uri"; + + /** CustomerService _email. */ + public _email?: "email"; + + /** CustomerService _phone. */ + public _phone?: "phone"; + + /** + * Creates a new CustomerService instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerService instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ICustomerService): google.shopping.merchant.accounts.v1beta.CustomerService; + + /** + * Encodes the specified CustomerService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CustomerService.verify|verify} messages. + * @param message CustomerService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ICustomerService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CustomerService.verify|verify} messages. + * @param message CustomerService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICustomerService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerService + * @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.CustomerService; + + /** + * Decodes a CustomerService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerService + * @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.CustomerService; + + /** + * Verifies a CustomerService 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 CustomerService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerService + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CustomerService; + + /** + * Creates a plain object from a CustomerService message. Also converts values to other types if specified. + * @param message CustomerService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.CustomerService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PhoneVerificationState enum. */ + enum PhoneVerificationState { + PHONE_VERIFICATION_STATE_UNSPECIFIED = 0, + PHONE_VERIFICATION_STATE_VERIFIED = 1, + PHONE_VERIFICATION_STATE_UNVERIFIED = 2 + } + + /** Represents an EmailPreferencesService */ + class EmailPreferencesService extends $protobuf.rpc.Service { + + /** + * Constructs a new EmailPreferencesService 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 EmailPreferencesService 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): EmailPreferencesService; + + /** + * Calls GetEmailPreferences. + * @param request GetEmailPreferencesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EmailPreferences + */ + public getEmailPreferences(request: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, callback: google.shopping.merchant.accounts.v1beta.EmailPreferencesService.GetEmailPreferencesCallback): void; + + /** + * Calls GetEmailPreferences. + * @param request GetEmailPreferencesRequest message or plain object + * @returns Promise + */ + public getEmailPreferences(request: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest): Promise; + + /** + * Calls UpdateEmailPreferences. + * @param request UpdateEmailPreferencesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EmailPreferences + */ + public updateEmailPreferences(request: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, callback: google.shopping.merchant.accounts.v1beta.EmailPreferencesService.UpdateEmailPreferencesCallback): void; + + /** + * Calls UpdateEmailPreferences. + * @param request UpdateEmailPreferencesRequest message or plain object + * @returns Promise + */ + public updateEmailPreferences(request: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest): Promise; + } + + namespace EmailPreferencesService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.EmailPreferencesService|getEmailPreferences}. + * @param error Error, if any + * @param [response] EmailPreferences + */ + type GetEmailPreferencesCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.EmailPreferences) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.EmailPreferencesService|updateEmailPreferences}. + * @param error Error, if any + * @param [response] EmailPreferences + */ + type UpdateEmailPreferencesCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.EmailPreferences) => void; + } + + /** Properties of an EmailPreferences. */ + interface IEmailPreferences { + + /** EmailPreferences name */ + name?: (string|null); + + /** EmailPreferences newsAndTips */ + newsAndTips?: (google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState|keyof typeof google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState|null); + } + + /** Represents an EmailPreferences. */ + class EmailPreferences implements IEmailPreferences { + + /** + * Constructs a new EmailPreferences. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IEmailPreferences); + + /** EmailPreferences name. */ + public name: string; + + /** EmailPreferences newsAndTips. */ + public newsAndTips: (google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState|keyof typeof google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState); + + /** + * Creates a new EmailPreferences instance using the specified properties. + * @param [properties] Properties to set + * @returns EmailPreferences instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IEmailPreferences): google.shopping.merchant.accounts.v1beta.EmailPreferences; + + /** + * Encodes the specified EmailPreferences message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EmailPreferences.verify|verify} messages. + * @param message EmailPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EmailPreferences.verify|verify} messages. + * @param message EmailPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmailPreferences + * @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.EmailPreferences; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmailPreferences + * @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.EmailPreferences; + + /** + * Verifies an EmailPreferences 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 EmailPreferences message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmailPreferences + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.EmailPreferences; + + /** + * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. + * @param message EmailPreferences + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.EmailPreferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmailPreferences to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmailPreferences + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EmailPreferences { + + /** OptInState enum. */ + enum OptInState { + OPT_IN_STATE_UNSPECIFIED = 0, + OPTED_OUT = 1, + OPTED_IN = 2, + UNCONFIRMED = 3 + } + } + + /** Properties of a GetEmailPreferencesRequest. */ + interface IGetEmailPreferencesRequest { + + /** GetEmailPreferencesRequest name */ + name?: (string|null); + } + + /** Represents a GetEmailPreferencesRequest. */ + class GetEmailPreferencesRequest implements IGetEmailPreferencesRequest { + + /** + * Constructs a new GetEmailPreferencesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest); + + /** GetEmailPreferencesRequest name. */ + public name: string; + + /** + * Creates a new GetEmailPreferencesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEmailPreferencesRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest): google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest; + + /** + * Encodes the specified GetEmailPreferencesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest.verify|verify} messages. + * @param message GetEmailPreferencesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEmailPreferencesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest.verify|verify} messages. + * @param message GetEmailPreferencesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEmailPreferencesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEmailPreferencesRequest + * @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.GetEmailPreferencesRequest; + + /** + * Decodes a GetEmailPreferencesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEmailPreferencesRequest + * @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.GetEmailPreferencesRequest; + + /** + * Verifies a GetEmailPreferencesRequest 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 GetEmailPreferencesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEmailPreferencesRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest; + + /** + * Creates a plain object from a GetEmailPreferencesRequest message. Also converts values to other types if specified. + * @param message GetEmailPreferencesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEmailPreferencesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEmailPreferencesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEmailPreferencesRequest. */ + interface IUpdateEmailPreferencesRequest { + + /** UpdateEmailPreferencesRequest emailPreferences */ + emailPreferences?: (google.shopping.merchant.accounts.v1beta.IEmailPreferences|null); + + /** UpdateEmailPreferencesRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateEmailPreferencesRequest. */ + class UpdateEmailPreferencesRequest implements IUpdateEmailPreferencesRequest { + + /** + * Constructs a new UpdateEmailPreferencesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest); + + /** UpdateEmailPreferencesRequest emailPreferences. */ + public emailPreferences?: (google.shopping.merchant.accounts.v1beta.IEmailPreferences|null); + + /** UpdateEmailPreferencesRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateEmailPreferencesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEmailPreferencesRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest): google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest; + + /** + * Encodes the specified UpdateEmailPreferencesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.verify|verify} messages. + * @param message UpdateEmailPreferencesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEmailPreferencesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.verify|verify} messages. + * @param message UpdateEmailPreferencesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEmailPreferencesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEmailPreferencesRequest + * @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.UpdateEmailPreferencesRequest; + + /** + * Decodes an UpdateEmailPreferencesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEmailPreferencesRequest + * @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.UpdateEmailPreferencesRequest; + + /** + * Verifies an UpdateEmailPreferencesRequest 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 UpdateEmailPreferencesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEmailPreferencesRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest; + + /** + * Creates a plain object from an UpdateEmailPreferencesRequest message. Also converts values to other types if specified. + * @param message UpdateEmailPreferencesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEmailPreferencesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEmailPreferencesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a HomepageService */ + class HomepageService extends $protobuf.rpc.Service { + + /** + * Constructs a new HomepageService 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 HomepageService 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): HomepageService; + + /** + * Calls GetHomepage. + * @param request GetHomepageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Homepage + */ + public getHomepage(request: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, callback: google.shopping.merchant.accounts.v1beta.HomepageService.GetHomepageCallback): void; + + /** + * Calls GetHomepage. + * @param request GetHomepageRequest message or plain object + * @returns Promise + */ + public getHomepage(request: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest): Promise; + + /** + * Calls UpdateHomepage. + * @param request UpdateHomepageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Homepage + */ + public updateHomepage(request: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, callback: google.shopping.merchant.accounts.v1beta.HomepageService.UpdateHomepageCallback): void; + + /** + * Calls UpdateHomepage. + * @param request UpdateHomepageRequest message or plain object + * @returns Promise + */ + public updateHomepage(request: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest): Promise; + + /** + * Calls ClaimHomepage. + * @param request ClaimHomepageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Homepage + */ + public claimHomepage(request: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, callback: google.shopping.merchant.accounts.v1beta.HomepageService.ClaimHomepageCallback): void; + + /** + * Calls ClaimHomepage. + * @param request ClaimHomepageRequest message or plain object + * @returns Promise + */ + public claimHomepage(request: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest): Promise; + + /** + * Calls UnclaimHomepage. + * @param request UnclaimHomepageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Homepage + */ + public unclaimHomepage(request: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, callback: google.shopping.merchant.accounts.v1beta.HomepageService.UnclaimHomepageCallback): void; + + /** + * Calls UnclaimHomepage. + * @param request UnclaimHomepageRequest message or plain object + * @returns Promise + */ + public unclaimHomepage(request: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest): Promise; + } + + namespace HomepageService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|getHomepage}. + * @param error Error, if any + * @param [response] Homepage + */ + type GetHomepageCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Homepage) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|updateHomepage}. + * @param error Error, if any + * @param [response] Homepage + */ + type UpdateHomepageCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Homepage) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|claimHomepage}. + * @param error Error, if any + * @param [response] Homepage + */ + type ClaimHomepageCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Homepage) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|unclaimHomepage}. + * @param error Error, if any + * @param [response] Homepage + */ + type UnclaimHomepageCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Homepage) => void; + } + + /** Properties of a Homepage. */ + interface IHomepage { + + /** Homepage name */ + name?: (string|null); + + /** Homepage uri */ + uri?: (string|null); + + /** Homepage claimed */ + claimed?: (boolean|null); + } + + /** Represents a Homepage. */ + class Homepage implements IHomepage { + + /** + * Constructs a new Homepage. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IHomepage); + + /** Homepage name. */ + public name: string; + + /** Homepage uri. */ + public uri?: (string|null); + + /** Homepage claimed. */ + public claimed: boolean; + + /** Homepage _uri. */ + public _uri?: "uri"; + + /** + * Creates a new Homepage instance using the specified properties. + * @param [properties] Properties to set + * @returns Homepage instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IHomepage): google.shopping.merchant.accounts.v1beta.Homepage; + + /** + * Encodes the specified Homepage message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Homepage.verify|verify} messages. + * @param message Homepage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IHomepage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Homepage message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Homepage.verify|verify} messages. + * @param message Homepage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IHomepage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Homepage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Homepage + * @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.Homepage; + + /** + * Decodes a Homepage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Homepage + * @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.Homepage; + + /** + * Verifies a Homepage 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 Homepage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Homepage + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Homepage; + + /** + * Creates a plain object from a Homepage message. Also converts values to other types if specified. + * @param message Homepage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Homepage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Homepage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Homepage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetHomepageRequest. */ + interface IGetHomepageRequest { + + /** GetHomepageRequest name */ + name?: (string|null); + } + + /** Represents a GetHomepageRequest. */ + class GetHomepageRequest implements IGetHomepageRequest { + + /** + * Constructs a new GetHomepageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest); + + /** GetHomepageRequest name. */ + public name: string; + + /** + * Creates a new GetHomepageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetHomepageRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest): google.shopping.merchant.accounts.v1beta.GetHomepageRequest; + + /** + * Encodes the specified GetHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetHomepageRequest.verify|verify} messages. + * @param message GetHomepageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetHomepageRequest.verify|verify} messages. + * @param message GetHomepageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetHomepageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetHomepageRequest + * @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.GetHomepageRequest; + + /** + * Decodes a GetHomepageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetHomepageRequest + * @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.GetHomepageRequest; + + /** + * Verifies a GetHomepageRequest 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 GetHomepageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetHomepageRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetHomepageRequest; + + /** + * Creates a plain object from a GetHomepageRequest message. Also converts values to other types if specified. + * @param message GetHomepageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetHomepageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetHomepageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetHomepageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateHomepageRequest. */ + interface IUpdateHomepageRequest { + + /** UpdateHomepageRequest homepage */ + homepage?: (google.shopping.merchant.accounts.v1beta.IHomepage|null); + + /** UpdateHomepageRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateHomepageRequest. */ + class UpdateHomepageRequest implements IUpdateHomepageRequest { + + /** + * Constructs a new UpdateHomepageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest); + + /** UpdateHomepageRequest homepage. */ + public homepage?: (google.shopping.merchant.accounts.v1beta.IHomepage|null); + + /** UpdateHomepageRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateHomepageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateHomepageRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest): google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest; + + /** + * Encodes the specified UpdateHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.verify|verify} messages. + * @param message UpdateHomepageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.verify|verify} messages. + * @param message UpdateHomepageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateHomepageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateHomepageRequest + * @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.UpdateHomepageRequest; + + /** + * Decodes an UpdateHomepageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateHomepageRequest + * @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.UpdateHomepageRequest; + + /** + * Verifies an UpdateHomepageRequest 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 UpdateHomepageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateHomepageRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest; + + /** + * Creates a plain object from an UpdateHomepageRequest message. Also converts values to other types if specified. + * @param message UpdateHomepageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateHomepageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateHomepageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClaimHomepageRequest. */ + interface IClaimHomepageRequest { + + /** ClaimHomepageRequest name */ + name?: (string|null); + } + + /** Represents a ClaimHomepageRequest. */ + class ClaimHomepageRequest implements IClaimHomepageRequest { + + /** + * Constructs a new ClaimHomepageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest); + + /** ClaimHomepageRequest name. */ + public name: string; + + /** + * Creates a new ClaimHomepageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ClaimHomepageRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest): google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest; + + /** + * Encodes the specified ClaimHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest.verify|verify} messages. + * @param message ClaimHomepageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClaimHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest.verify|verify} messages. + * @param message ClaimHomepageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClaimHomepageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClaimHomepageRequest + * @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.ClaimHomepageRequest; + + /** + * Decodes a ClaimHomepageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClaimHomepageRequest + * @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.ClaimHomepageRequest; + + /** + * Verifies a ClaimHomepageRequest 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 ClaimHomepageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClaimHomepageRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest; + + /** + * Creates a plain object from a ClaimHomepageRequest message. Also converts values to other types if specified. + * @param message ClaimHomepageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClaimHomepageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClaimHomepageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnclaimHomepageRequest. */ + interface IUnclaimHomepageRequest { + + /** UnclaimHomepageRequest name */ + name?: (string|null); + } + + /** Represents an UnclaimHomepageRequest. */ + class UnclaimHomepageRequest implements IUnclaimHomepageRequest { + + /** + * Constructs a new UnclaimHomepageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest); + + /** UnclaimHomepageRequest name. */ + public name: string; + + /** + * Creates a new UnclaimHomepageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UnclaimHomepageRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest): google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest; + + /** + * Encodes the specified UnclaimHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest.verify|verify} messages. + * @param message UnclaimHomepageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnclaimHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest.verify|verify} messages. + * @param message UnclaimHomepageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnclaimHomepageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnclaimHomepageRequest + * @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.UnclaimHomepageRequest; + + /** + * Decodes an UnclaimHomepageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnclaimHomepageRequest + * @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.UnclaimHomepageRequest; + + /** + * Verifies an UnclaimHomepageRequest 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 UnclaimHomepageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnclaimHomepageRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest; + + /** + * Creates a plain object from an UnclaimHomepageRequest message. Also converts values to other types if specified. + * @param message UnclaimHomepageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnclaimHomepageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnclaimHomepageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an OnlineReturnPolicyService */ + class OnlineReturnPolicyService extends $protobuf.rpc.Service { + + /** + * Constructs a new OnlineReturnPolicyService 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 OnlineReturnPolicyService 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): OnlineReturnPolicyService; + + /** + * Calls GetOnlineReturnPolicy. + * @param request GetOnlineReturnPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OnlineReturnPolicy + */ + public getOnlineReturnPolicy(request: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, callback: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.GetOnlineReturnPolicyCallback): void; + + /** + * Calls GetOnlineReturnPolicy. + * @param request GetOnlineReturnPolicyRequest message or plain object + * @returns Promise + */ + public getOnlineReturnPolicy(request: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest): Promise; + + /** + * Calls ListOnlineReturnPolicies. + * @param request ListOnlineReturnPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOnlineReturnPoliciesResponse + */ + public listOnlineReturnPolicies(request: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, callback: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.ListOnlineReturnPoliciesCallback): void; + + /** + * Calls ListOnlineReturnPolicies. + * @param request ListOnlineReturnPoliciesRequest message or plain object + * @returns Promise + */ + public listOnlineReturnPolicies(request: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest): Promise; + } + + namespace OnlineReturnPolicyService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService|getOnlineReturnPolicy}. + * @param error Error, if any + * @param [response] OnlineReturnPolicy + */ + type GetOnlineReturnPolicyCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService|listOnlineReturnPolicies}. + * @param error Error, if any + * @param [response] ListOnlineReturnPoliciesResponse + */ + type ListOnlineReturnPoliciesCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse) => void; + } + + /** Properties of a GetOnlineReturnPolicyRequest. */ + interface IGetOnlineReturnPolicyRequest { + + /** GetOnlineReturnPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetOnlineReturnPolicyRequest. */ + class GetOnlineReturnPolicyRequest implements IGetOnlineReturnPolicyRequest { + + /** + * Constructs a new GetOnlineReturnPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest); + + /** GetOnlineReturnPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetOnlineReturnPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOnlineReturnPolicyRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest): google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest; + + /** + * Encodes the specified GetOnlineReturnPolicyRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest.verify|verify} messages. + * @param message GetOnlineReturnPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOnlineReturnPolicyRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest.verify|verify} messages. + * @param message GetOnlineReturnPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOnlineReturnPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOnlineReturnPolicyRequest + * @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.GetOnlineReturnPolicyRequest; + + /** + * Decodes a GetOnlineReturnPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOnlineReturnPolicyRequest + * @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.GetOnlineReturnPolicyRequest; + + /** + * Verifies a GetOnlineReturnPolicyRequest 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 GetOnlineReturnPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOnlineReturnPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest; + + /** + * Creates a plain object from a GetOnlineReturnPolicyRequest message. Also converts values to other types if specified. + * @param message GetOnlineReturnPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOnlineReturnPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOnlineReturnPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOnlineReturnPoliciesRequest. */ + interface IListOnlineReturnPoliciesRequest { + + /** ListOnlineReturnPoliciesRequest parent */ + parent?: (string|null); + + /** ListOnlineReturnPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListOnlineReturnPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOnlineReturnPoliciesRequest. */ + class ListOnlineReturnPoliciesRequest implements IListOnlineReturnPoliciesRequest { + + /** + * Constructs a new ListOnlineReturnPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest); + + /** ListOnlineReturnPoliciesRequest parent. */ + public parent: string; + + /** ListOnlineReturnPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListOnlineReturnPoliciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOnlineReturnPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOnlineReturnPoliciesRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest): google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest; + + /** + * Encodes the specified ListOnlineReturnPoliciesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest.verify|verify} messages. + * @param message ListOnlineReturnPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOnlineReturnPoliciesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest.verify|verify} messages. + * @param message ListOnlineReturnPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOnlineReturnPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOnlineReturnPoliciesRequest + * @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.ListOnlineReturnPoliciesRequest; + + /** + * Decodes a ListOnlineReturnPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOnlineReturnPoliciesRequest + * @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.ListOnlineReturnPoliciesRequest; + + /** + * Verifies a ListOnlineReturnPoliciesRequest 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 ListOnlineReturnPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOnlineReturnPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest; + + /** + * Creates a plain object from a ListOnlineReturnPoliciesRequest message. Also converts values to other types if specified. + * @param message ListOnlineReturnPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOnlineReturnPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOnlineReturnPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOnlineReturnPoliciesResponse. */ + interface IListOnlineReturnPoliciesResponse { + + /** ListOnlineReturnPoliciesResponse onlineReturnPolicies */ + onlineReturnPolicies?: (google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[]|null); + + /** ListOnlineReturnPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOnlineReturnPoliciesResponse. */ + class ListOnlineReturnPoliciesResponse implements IListOnlineReturnPoliciesResponse { + + /** + * Constructs a new ListOnlineReturnPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse); + + /** ListOnlineReturnPoliciesResponse onlineReturnPolicies. */ + public onlineReturnPolicies: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[]; + + /** ListOnlineReturnPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOnlineReturnPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOnlineReturnPoliciesResponse instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse): google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse; + + /** + * Encodes the specified ListOnlineReturnPoliciesResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.verify|verify} messages. + * @param message ListOnlineReturnPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOnlineReturnPoliciesResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.verify|verify} messages. + * @param message ListOnlineReturnPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOnlineReturnPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOnlineReturnPoliciesResponse + * @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.ListOnlineReturnPoliciesResponse; + + /** + * Decodes a ListOnlineReturnPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOnlineReturnPoliciesResponse + * @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.ListOnlineReturnPoliciesResponse; + + /** + * Verifies a ListOnlineReturnPoliciesResponse 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 ListOnlineReturnPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOnlineReturnPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse; + + /** + * Creates a plain object from a ListOnlineReturnPoliciesResponse message. Also converts values to other types if specified. + * @param message ListOnlineReturnPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOnlineReturnPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOnlineReturnPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnlineReturnPolicy. */ + interface IOnlineReturnPolicy { + + /** OnlineReturnPolicy name */ + name?: (string|null); + + /** OnlineReturnPolicy returnPolicyId */ + returnPolicyId?: (string|null); + + /** OnlineReturnPolicy label */ + label?: (string|null); + + /** OnlineReturnPolicy countries */ + countries?: (string[]|null); + + /** OnlineReturnPolicy policy */ + policy?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy|null); + + /** OnlineReturnPolicy restockingFee */ + restockingFee?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee|null); + + /** OnlineReturnPolicy returnMethods */ + returnMethods?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod[]|null); + + /** OnlineReturnPolicy itemConditions */ + itemConditions?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition[]|null); + + /** OnlineReturnPolicy returnShippingFee */ + returnShippingFee?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee|null); + + /** OnlineReturnPolicy returnPolicyUri */ + returnPolicyUri?: (string|null); + + /** OnlineReturnPolicy acceptDefectiveOnly */ + acceptDefectiveOnly?: (boolean|null); + + /** OnlineReturnPolicy processRefundDays */ + processRefundDays?: (number|null); + + /** OnlineReturnPolicy acceptExchange */ + acceptExchange?: (boolean|null); + } + + /** Represents an OnlineReturnPolicy. */ + class OnlineReturnPolicy implements IOnlineReturnPolicy { + + /** + * Constructs a new OnlineReturnPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy); + + /** OnlineReturnPolicy name. */ + public name: string; + + /** OnlineReturnPolicy returnPolicyId. */ + public returnPolicyId: string; + + /** OnlineReturnPolicy label. */ + public label: string; + + /** OnlineReturnPolicy countries. */ + public countries: string[]; + + /** OnlineReturnPolicy policy. */ + public policy?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy|null); + + /** OnlineReturnPolicy restockingFee. */ + public restockingFee?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee|null); + + /** OnlineReturnPolicy returnMethods. */ + public returnMethods: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod[]; + + /** OnlineReturnPolicy itemConditions. */ + public itemConditions: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition[]; + + /** OnlineReturnPolicy returnShippingFee. */ + public returnShippingFee?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee|null); + + /** OnlineReturnPolicy returnPolicyUri. */ + public returnPolicyUri: string; + + /** OnlineReturnPolicy acceptDefectiveOnly. */ + public acceptDefectiveOnly?: (boolean|null); + + /** OnlineReturnPolicy processRefundDays. */ + public processRefundDays?: (number|null); + + /** OnlineReturnPolicy acceptExchange. */ + public acceptExchange?: (boolean|null); + + /** OnlineReturnPolicy _acceptDefectiveOnly. */ + public _acceptDefectiveOnly?: "acceptDefectiveOnly"; + + /** OnlineReturnPolicy _processRefundDays. */ + public _processRefundDays?: "processRefundDays"; + + /** OnlineReturnPolicy _acceptExchange. */ + public _acceptExchange?: "acceptExchange"; + + /** + * Creates a new OnlineReturnPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns OnlineReturnPolicy instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy; + + /** + * Encodes the specified OnlineReturnPolicy message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify|verify} messages. + * @param message OnlineReturnPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OnlineReturnPolicy message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify|verify} messages. + * @param message OnlineReturnPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OnlineReturnPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnlineReturnPolicy + * @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.OnlineReturnPolicy; + + /** + * Decodes an OnlineReturnPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnlineReturnPolicy + * @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.OnlineReturnPolicy; + + /** + * Verifies an OnlineReturnPolicy 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 OnlineReturnPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnlineReturnPolicy + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy; + + /** + * Creates a plain object from an OnlineReturnPolicy message. Also converts values to other types if specified. + * @param message OnlineReturnPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OnlineReturnPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnlineReturnPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OnlineReturnPolicy { + + /** Properties of a ReturnShippingFee. */ + interface IReturnShippingFee { + + /** ReturnShippingFee type */ + type?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type|keyof typeof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type|null); + + /** ReturnShippingFee fixedFee */ + fixedFee?: (google.shopping.type.IPrice|null); + } + + /** Represents a ReturnShippingFee. */ + class ReturnShippingFee implements IReturnShippingFee { + + /** + * Constructs a new ReturnShippingFee. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee); + + /** ReturnShippingFee type. */ + public type: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type|keyof typeof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type); + + /** ReturnShippingFee fixedFee. */ + public fixedFee?: (google.shopping.type.IPrice|null); + + /** + * Creates a new ReturnShippingFee instance using the specified properties. + * @param [properties] Properties to set + * @returns ReturnShippingFee instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee; + + /** + * Encodes the specified ReturnShippingFee message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify|verify} messages. + * @param message ReturnShippingFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReturnShippingFee message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify|verify} messages. + * @param message ReturnShippingFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReturnShippingFee message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReturnShippingFee + * @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.OnlineReturnPolicy.ReturnShippingFee; + + /** + * Decodes a ReturnShippingFee message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReturnShippingFee + * @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.OnlineReturnPolicy.ReturnShippingFee; + + /** + * Verifies a ReturnShippingFee 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 ReturnShippingFee message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReturnShippingFee + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee; + + /** + * Creates a plain object from a ReturnShippingFee message. Also converts values to other types if specified. + * @param message ReturnShippingFee + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReturnShippingFee to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReturnShippingFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReturnShippingFee { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + FIXED = 1, + CUSTOMER_PAYING_ACTUAL_FEE = 2 + } + } + + /** Properties of a RestockingFee. */ + interface IRestockingFee { + + /** RestockingFee fixedFee */ + fixedFee?: (google.shopping.type.IPrice|null); + + /** RestockingFee microPercent */ + microPercent?: (number|null); + } + + /** Represents a RestockingFee. */ + class RestockingFee implements IRestockingFee { + + /** + * Constructs a new RestockingFee. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee); + + /** RestockingFee fixedFee. */ + public fixedFee?: (google.shopping.type.IPrice|null); + + /** RestockingFee microPercent. */ + public microPercent?: (number|null); + + /** RestockingFee type. */ + public type?: ("fixedFee"|"microPercent"); + + /** + * Creates a new RestockingFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RestockingFee instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee; + + /** + * Encodes the specified RestockingFee message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify|verify} messages. + * @param message RestockingFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestockingFee message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify|verify} messages. + * @param message RestockingFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestockingFee message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestockingFee + * @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.OnlineReturnPolicy.RestockingFee; + + /** + * Decodes a RestockingFee message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestockingFee + * @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.OnlineReturnPolicy.RestockingFee; + + /** + * Verifies a RestockingFee 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 RestockingFee message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestockingFee + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee; + + /** + * Creates a plain object from a RestockingFee message. Also converts values to other types if specified. + * @param message RestockingFee + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestockingFee to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestockingFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy type */ + type?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type|keyof typeof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type|null); + + /** Policy days */ + days?: (number|Long|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy); + + /** Policy type. */ + public type: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type|keyof typeof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type); + + /** Policy days. */ + public days: (number|Long|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.OnlineReturnPolicy.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.OnlineReturnPolicy.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Policy { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + NUMBER_OF_DAYS_AFTER_DELIVERY = 1, + NO_RETURNS = 2, + LIFETIME_RETURNS = 3 + } + } + + /** ReturnMethod enum. */ + enum ReturnMethod { + RETURN_METHOD_UNSPECIFIED = 0, + BY_MAIL = 1, + IN_STORE = 2, + AT_A_KIOSK = 3 + } + + /** ItemCondition enum. */ + enum ItemCondition { + ITEM_CONDITION_UNSPECIFIED = 0, + NEW = 1, + USED = 2 + } + } + + /** Represents a ProgramsService */ + class ProgramsService extends $protobuf.rpc.Service { + + /** + * Constructs a new ProgramsService 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 ProgramsService 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): ProgramsService; + + /** + * Calls GetProgram. + * @param request GetProgramRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Program + */ + public getProgram(request: google.shopping.merchant.accounts.v1beta.IGetProgramRequest, callback: google.shopping.merchant.accounts.v1beta.ProgramsService.GetProgramCallback): void; + + /** + * Calls GetProgram. + * @param request GetProgramRequest message or plain object + * @returns Promise + */ + public getProgram(request: google.shopping.merchant.accounts.v1beta.IGetProgramRequest): Promise; + + /** + * Calls ListPrograms. + * @param request ListProgramsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProgramsResponse + */ + public listPrograms(request: google.shopping.merchant.accounts.v1beta.IListProgramsRequest, callback: google.shopping.merchant.accounts.v1beta.ProgramsService.ListProgramsCallback): void; + + /** + * Calls ListPrograms. + * @param request ListProgramsRequest message or plain object + * @returns Promise + */ + public listPrograms(request: google.shopping.merchant.accounts.v1beta.IListProgramsRequest): Promise; + + /** + * Calls EnableProgram. + * @param request EnableProgramRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Program + */ + public enableProgram(request: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, callback: google.shopping.merchant.accounts.v1beta.ProgramsService.EnableProgramCallback): void; + + /** + * Calls EnableProgram. + * @param request EnableProgramRequest message or plain object + * @returns Promise + */ + public enableProgram(request: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest): Promise; + + /** + * Calls DisableProgram. + * @param request DisableProgramRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Program + */ + public disableProgram(request: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, callback: google.shopping.merchant.accounts.v1beta.ProgramsService.DisableProgramCallback): void; + + /** + * Calls DisableProgram. + * @param request DisableProgramRequest message or plain object + * @returns Promise + */ + public disableProgram(request: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest): Promise; + } + + namespace ProgramsService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|getProgram}. + * @param error Error, if any + * @param [response] Program + */ + type GetProgramCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Program) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|listPrograms}. + * @param error Error, if any + * @param [response] ListProgramsResponse + */ + type ListProgramsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListProgramsResponse) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|enableProgram}. + * @param error Error, if any + * @param [response] Program + */ + type EnableProgramCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Program) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|disableProgram}. + * @param error Error, if any + * @param [response] Program + */ + type DisableProgramCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Program) => void; + } + + /** Properties of a Program. */ + interface IProgram { + + /** Program name */ + name?: (string|null); + + /** Program documentationUri */ + documentationUri?: (string|null); + + /** Program state */ + state?: (google.shopping.merchant.accounts.v1beta.Program.State|keyof typeof google.shopping.merchant.accounts.v1beta.Program.State|null); + + /** Program activeRegionCodes */ + activeRegionCodes?: (string[]|null); + + /** Program unmetRequirements */ + unmetRequirements?: (google.shopping.merchant.accounts.v1beta.Program.IRequirement[]|null); + } + + /** Represents a Program. */ + class Program implements IProgram { + + /** + * Constructs a new Program. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IProgram); + + /** Program name. */ + public name: string; + + /** Program documentationUri. */ + public documentationUri: string; + + /** Program state. */ + public state: (google.shopping.merchant.accounts.v1beta.Program.State|keyof typeof google.shopping.merchant.accounts.v1beta.Program.State); + + /** Program activeRegionCodes. */ + public activeRegionCodes: string[]; + + /** Program unmetRequirements. */ + public unmetRequirements: google.shopping.merchant.accounts.v1beta.Program.IRequirement[]; + + /** + * Creates a new Program instance using the specified properties. + * @param [properties] Properties to set + * @returns Program instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IProgram): google.shopping.merchant.accounts.v1beta.Program; + + /** + * Encodes the specified Program message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.verify|verify} messages. + * @param message Program message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IProgram, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Program message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.verify|verify} messages. + * @param message Program message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IProgram, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Program message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Program + * @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.Program; + + /** + * Decodes a Program message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Program + * @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.Program; + + /** + * Verifies a Program 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 Program message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Program + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Program; + + /** + * Creates a plain object from a Program message. Also converts values to other types if specified. + * @param message Program + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Program, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Program to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Program + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Program { + + /** Properties of a Requirement. */ + interface IRequirement { + + /** Requirement title */ + title?: (string|null); + + /** Requirement documentationUri */ + documentationUri?: (string|null); + + /** Requirement affectedRegionCodes */ + affectedRegionCodes?: (string[]|null); + } + + /** Represents a Requirement. */ + class Requirement implements IRequirement { + + /** + * Constructs a new Requirement. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.Program.IRequirement); + + /** Requirement title. */ + public title: string; + + /** Requirement documentationUri. */ + public documentationUri: string; + + /** Requirement affectedRegionCodes. */ + public affectedRegionCodes: string[]; + + /** + * Creates a new Requirement instance using the specified properties. + * @param [properties] Properties to set + * @returns Requirement instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.Program.IRequirement): google.shopping.merchant.accounts.v1beta.Program.Requirement; + + /** + * Encodes the specified Requirement message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.Requirement.verify|verify} messages. + * @param message Requirement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.Program.IRequirement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Requirement message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.Requirement.verify|verify} messages. + * @param message Requirement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Program.IRequirement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Requirement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Requirement + * @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.Program.Requirement; + + /** + * Decodes a Requirement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Requirement + * @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.Program.Requirement; + + /** + * Verifies a Requirement 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 Requirement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Requirement + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Program.Requirement; + + /** + * Creates a plain object from a Requirement message. Also converts values to other types if specified. + * @param message Requirement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Program.Requirement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Requirement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Requirement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + NOT_ELIGIBLE = 1, + ELIGIBLE = 2, + ENABLED = 3 + } + } + + /** Properties of a GetProgramRequest. */ + interface IGetProgramRequest { + + /** GetProgramRequest name */ + name?: (string|null); + } + + /** Represents a GetProgramRequest. */ + class GetProgramRequest implements IGetProgramRequest { + + /** + * Constructs a new GetProgramRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetProgramRequest); + + /** GetProgramRequest name. */ + public name: string; + + /** + * Creates a new GetProgramRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProgramRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetProgramRequest): google.shopping.merchant.accounts.v1beta.GetProgramRequest; + + /** + * Encodes the specified GetProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetProgramRequest.verify|verify} messages. + * @param message GetProgramRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetProgramRequest.verify|verify} messages. + * @param message GetProgramRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProgramRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProgramRequest + * @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.GetProgramRequest; + + /** + * Decodes a GetProgramRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProgramRequest + * @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.GetProgramRequest; + + /** + * Verifies a GetProgramRequest 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 GetProgramRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProgramRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetProgramRequest; + + /** + * Creates a plain object from a GetProgramRequest message. Also converts values to other types if specified. + * @param message GetProgramRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetProgramRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProgramRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProgramRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProgramsRequest. */ + interface IListProgramsRequest { + + /** ListProgramsRequest parent */ + parent?: (string|null); + + /** ListProgramsRequest pageSize */ + pageSize?: (number|null); + + /** ListProgramsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProgramsRequest. */ + class ListProgramsRequest implements IListProgramsRequest { + + /** + * Constructs a new ListProgramsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListProgramsRequest); + + /** ListProgramsRequest parent. */ + public parent: string; + + /** ListProgramsRequest pageSize. */ + public pageSize: number; + + /** ListProgramsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProgramsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProgramsRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListProgramsRequest): google.shopping.merchant.accounts.v1beta.ListProgramsRequest; + + /** + * Encodes the specified ListProgramsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsRequest.verify|verify} messages. + * @param message ListProgramsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListProgramsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProgramsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsRequest.verify|verify} messages. + * @param message ListProgramsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListProgramsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProgramsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProgramsRequest + * @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.ListProgramsRequest; + + /** + * Decodes a ListProgramsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProgramsRequest + * @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.ListProgramsRequest; + + /** + * Verifies a ListProgramsRequest 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 ListProgramsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProgramsRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListProgramsRequest; + + /** + * Creates a plain object from a ListProgramsRequest message. Also converts values to other types if specified. + * @param message ListProgramsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListProgramsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProgramsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProgramsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProgramsResponse. */ + interface IListProgramsResponse { + + /** ListProgramsResponse programs */ + programs?: (google.shopping.merchant.accounts.v1beta.IProgram[]|null); + + /** ListProgramsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProgramsResponse. */ + class ListProgramsResponse implements IListProgramsResponse { + + /** + * Constructs a new ListProgramsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListProgramsResponse); + + /** ListProgramsResponse programs. */ + public programs: google.shopping.merchant.accounts.v1beta.IProgram[]; + + /** ListProgramsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProgramsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProgramsResponse instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListProgramsResponse): google.shopping.merchant.accounts.v1beta.ListProgramsResponse; + + /** + * Encodes the specified ListProgramsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsResponse.verify|verify} messages. + * @param message ListProgramsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListProgramsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProgramsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsResponse.verify|verify} messages. + * @param message ListProgramsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListProgramsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProgramsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProgramsResponse + * @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.ListProgramsResponse; + + /** + * Decodes a ListProgramsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProgramsResponse + * @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.ListProgramsResponse; + + /** + * Verifies a ListProgramsResponse 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 ListProgramsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProgramsResponse + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListProgramsResponse; + + /** + * Creates a plain object from a ListProgramsResponse message. Also converts values to other types if specified. + * @param message ListProgramsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListProgramsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProgramsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProgramsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableProgramRequest. */ + interface IEnableProgramRequest { + + /** EnableProgramRequest name */ + name?: (string|null); + } + + /** Represents an EnableProgramRequest. */ + class EnableProgramRequest implements IEnableProgramRequest { + + /** + * Constructs a new EnableProgramRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest); + + /** EnableProgramRequest name. */ + public name: string; + + /** + * Creates a new EnableProgramRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableProgramRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest): google.shopping.merchant.accounts.v1beta.EnableProgramRequest; + + /** + * Encodes the specified EnableProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EnableProgramRequest.verify|verify} messages. + * @param message EnableProgramRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EnableProgramRequest.verify|verify} messages. + * @param message EnableProgramRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableProgramRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableProgramRequest + * @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.EnableProgramRequest; + + /** + * Decodes an EnableProgramRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableProgramRequest + * @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.EnableProgramRequest; + + /** + * Verifies an EnableProgramRequest 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 EnableProgramRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableProgramRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.EnableProgramRequest; + + /** + * Creates a plain object from an EnableProgramRequest message. Also converts values to other types if specified. + * @param message EnableProgramRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.EnableProgramRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableProgramRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableProgramRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableProgramRequest. */ + interface IDisableProgramRequest { + + /** DisableProgramRequest name */ + name?: (string|null); + } + + /** Represents a DisableProgramRequest. */ + class DisableProgramRequest implements IDisableProgramRequest { + + /** + * Constructs a new DisableProgramRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest); + + /** DisableProgramRequest name. */ + public name: string; + + /** + * Creates a new DisableProgramRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableProgramRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest): google.shopping.merchant.accounts.v1beta.DisableProgramRequest; + + /** + * Encodes the specified DisableProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DisableProgramRequest.verify|verify} messages. + * @param message DisableProgramRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DisableProgramRequest.verify|verify} messages. + * @param message DisableProgramRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableProgramRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableProgramRequest + * @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.DisableProgramRequest; + + /** + * Decodes a DisableProgramRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableProgramRequest + * @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.DisableProgramRequest; + + /** + * Verifies a DisableProgramRequest 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 DisableProgramRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableProgramRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DisableProgramRequest; + + /** + * Creates a plain object from a DisableProgramRequest message. Also converts values to other types if specified. + * @param message DisableProgramRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.DisableProgramRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableProgramRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableProgramRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a RegionsService */ + class RegionsService extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionsService 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 RegionsService 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): RegionsService; + + /** + * Calls GetRegion. + * @param request GetRegionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Region + */ + public getRegion(request: google.shopping.merchant.accounts.v1beta.IGetRegionRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.GetRegionCallback): void; + + /** + * Calls GetRegion. + * @param request GetRegionRequest message or plain object + * @returns Promise + */ + public getRegion(request: google.shopping.merchant.accounts.v1beta.IGetRegionRequest): Promise; + + /** + * Calls CreateRegion. + * @param request CreateRegionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Region + */ + public createRegion(request: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.CreateRegionCallback): void; + + /** + * Calls CreateRegion. + * @param request CreateRegionRequest message or plain object + * @returns Promise + */ + public createRegion(request: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest): Promise; + + /** + * Calls UpdateRegion. + * @param request UpdateRegionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Region + */ + public updateRegion(request: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.UpdateRegionCallback): void; + + /** + * Calls UpdateRegion. + * @param request UpdateRegionRequest message or plain object + * @returns Promise + */ + public updateRegion(request: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest): Promise; + + /** + * Calls DeleteRegion. + * @param request DeleteRegionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteRegion(request: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.DeleteRegionCallback): void; + + /** + * Calls DeleteRegion. + * @param request DeleteRegionRequest message or plain object + * @returns Promise + */ + public deleteRegion(request: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest): Promise; + + /** + * Calls ListRegions. + * @param request ListRegionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRegionsResponse + */ + public listRegions(request: google.shopping.merchant.accounts.v1beta.IListRegionsRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.ListRegionsCallback): void; + + /** + * Calls ListRegions. + * @param request ListRegionsRequest message or plain object + * @returns Promise + */ + public listRegions(request: google.shopping.merchant.accounts.v1beta.IListRegionsRequest): Promise; + } + + namespace RegionsService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|getRegion}. + * @param error Error, if any + * @param [response] Region + */ + type GetRegionCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Region) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|createRegion}. + * @param error Error, if any + * @param [response] Region + */ + type CreateRegionCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Region) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|updateRegion}. + * @param error Error, if any + * @param [response] Region + */ + type UpdateRegionCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Region) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|deleteRegion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteRegionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|listRegions}. + * @param error Error, if any + * @param [response] ListRegionsResponse + */ + type ListRegionsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListRegionsResponse) => void; + } + + /** Properties of a GetRegionRequest. */ + interface IGetRegionRequest { + + /** GetRegionRequest name */ + name?: (string|null); + } + + /** Represents a GetRegionRequest. */ + class GetRegionRequest implements IGetRegionRequest { + + /** + * Constructs a new GetRegionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetRegionRequest); + + /** GetRegionRequest name. */ + public name: string; + + /** + * Creates a new GetRegionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetRegionRequest): google.shopping.merchant.accounts.v1beta.GetRegionRequest; + + /** + * Encodes the specified GetRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetRegionRequest.verify|verify} messages. + * @param message GetRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetRegionRequest.verify|verify} messages. + * @param message GetRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionRequest + * @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.GetRegionRequest; + + /** + * Decodes a GetRegionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionRequest + * @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.GetRegionRequest; + + /** + * Verifies a GetRegionRequest 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 GetRegionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetRegionRequest; + + /** + * Creates a plain object from a GetRegionRequest message. Also converts values to other types if specified. + * @param message GetRegionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetRegionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRegionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateRegionRequest. */ + interface ICreateRegionRequest { + + /** CreateRegionRequest parent */ + parent?: (string|null); + + /** CreateRegionRequest regionId */ + regionId?: (string|null); + + /** CreateRegionRequest region */ + region?: (google.shopping.merchant.accounts.v1beta.IRegion|null); + } + + /** Represents a CreateRegionRequest. */ + class CreateRegionRequest implements ICreateRegionRequest { + + /** + * Constructs a new CreateRegionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest); + + /** CreateRegionRequest parent. */ + public parent: string; + + /** CreateRegionRequest regionId. */ + public regionId: string; + + /** CreateRegionRequest region. */ + public region?: (google.shopping.merchant.accounts.v1beta.IRegion|null); + + /** + * Creates a new CreateRegionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRegionRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest): google.shopping.merchant.accounts.v1beta.CreateRegionRequest; + + /** + * Encodes the specified CreateRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateRegionRequest.verify|verify} messages. + * @param message CreateRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateRegionRequest.verify|verify} messages. + * @param message CreateRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRegionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRegionRequest + * @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.CreateRegionRequest; + + /** + * Decodes a CreateRegionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRegionRequest + * @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.CreateRegionRequest; + + /** + * Verifies a CreateRegionRequest 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 CreateRegionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRegionRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateRegionRequest; + + /** + * Creates a plain object from a CreateRegionRequest message. Also converts values to other types if specified. + * @param message CreateRegionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateRegionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRegionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRegionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateRegionRequest. */ + interface IUpdateRegionRequest { + + /** UpdateRegionRequest region */ + region?: (google.shopping.merchant.accounts.v1beta.IRegion|null); + + /** UpdateRegionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateRegionRequest. */ + class UpdateRegionRequest implements IUpdateRegionRequest { + + /** + * Constructs a new UpdateRegionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest); + + /** UpdateRegionRequest region. */ + public region?: (google.shopping.merchant.accounts.v1beta.IRegion|null); + + /** UpdateRegionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateRegionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRegionRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest): google.shopping.merchant.accounts.v1beta.UpdateRegionRequest; + + /** + * Encodes the specified UpdateRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.verify|verify} messages. + * @param message UpdateRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.verify|verify} messages. + * @param message UpdateRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRegionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRegionRequest + * @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.UpdateRegionRequest; + + /** + * Decodes an UpdateRegionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRegionRequest + * @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.UpdateRegionRequest; + + /** + * Verifies an UpdateRegionRequest 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 UpdateRegionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRegionRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateRegionRequest; + + /** + * Creates a plain object from an UpdateRegionRequest message. Also converts values to other types if specified. + * @param message UpdateRegionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateRegionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRegionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRegionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRegionRequest. */ + interface IDeleteRegionRequest { + + /** DeleteRegionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteRegionRequest. */ + class DeleteRegionRequest implements IDeleteRegionRequest { + + /** + * Constructs a new DeleteRegionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest); + + /** DeleteRegionRequest name. */ + public name: string; + + /** + * Creates a new DeleteRegionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest): google.shopping.merchant.accounts.v1beta.DeleteRegionRequest; + + /** + * Encodes the specified DeleteRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteRegionRequest.verify|verify} messages. + * @param message DeleteRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteRegionRequest.verify|verify} messages. + * @param message DeleteRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionRequest + * @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.DeleteRegionRequest; + + /** + * Decodes a DeleteRegionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionRequest + * @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.DeleteRegionRequest; + + /** + * Verifies a DeleteRegionRequest 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 DeleteRegionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DeleteRegionRequest; + + /** + * Creates a plain object from a DeleteRegionRequest message. Also converts values to other types if specified. + * @param message DeleteRegionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.DeleteRegionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRegionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRegionsRequest. */ + interface IListRegionsRequest { + + /** ListRegionsRequest parent */ + parent?: (string|null); + + /** ListRegionsRequest pageSize */ + pageSize?: (number|null); + + /** ListRegionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListRegionsRequest. */ + class ListRegionsRequest implements IListRegionsRequest { + + /** + * Constructs a new ListRegionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListRegionsRequest); + + /** ListRegionsRequest parent. */ + public parent: string; + + /** ListRegionsRequest pageSize. */ + public pageSize: number; + + /** ListRegionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListRegionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionsRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListRegionsRequest): google.shopping.merchant.accounts.v1beta.ListRegionsRequest; + + /** + * Encodes the specified ListRegionsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsRequest.verify|verify} messages. + * @param message ListRegionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListRegionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsRequest.verify|verify} messages. + * @param message ListRegionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListRegionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionsRequest + * @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.ListRegionsRequest; + + /** + * Decodes a ListRegionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionsRequest + * @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.ListRegionsRequest; + + /** + * Verifies a ListRegionsRequest 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 ListRegionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListRegionsRequest; + + /** + * Creates a plain object from a ListRegionsRequest message. Also converts values to other types if specified. + * @param message ListRegionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListRegionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRegionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRegionsResponse. */ + interface IListRegionsResponse { + + /** ListRegionsResponse regions */ + regions?: (google.shopping.merchant.accounts.v1beta.IRegion[]|null); + + /** ListRegionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRegionsResponse. */ + class ListRegionsResponse implements IListRegionsResponse { + + /** + * Constructs a new ListRegionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IListRegionsResponse); + + /** ListRegionsResponse regions. */ + public regions: google.shopping.merchant.accounts.v1beta.IRegion[]; + + /** ListRegionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRegionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionsResponse instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IListRegionsResponse): google.shopping.merchant.accounts.v1beta.ListRegionsResponse; + + /** + * Encodes the specified ListRegionsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsResponse.verify|verify} messages. + * @param message ListRegionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IListRegionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsResponse.verify|verify} messages. + * @param message ListRegionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListRegionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionsResponse + * @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.ListRegionsResponse; + + /** + * Decodes a ListRegionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionsResponse + * @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.ListRegionsResponse; + + /** + * Verifies a ListRegionsResponse 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 ListRegionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListRegionsResponse; + + /** + * Creates a plain object from a ListRegionsResponse message. Also converts values to other types if specified. + * @param message ListRegionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ListRegionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRegionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Region. */ + interface IRegion { + + /** Region name */ + name?: (string|null); + + /** Region displayName */ + displayName?: (string|null); + + /** Region postalCodeArea */ + postalCodeArea?: (google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea|null); + + /** Region geotargetArea */ + geotargetArea?: (google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea|null); + + /** Region regionalInventoryEligible */ + regionalInventoryEligible?: (google.protobuf.IBoolValue|null); + + /** Region shippingEligible */ + shippingEligible?: (google.protobuf.IBoolValue|null); + } + + /** Represents a Region. */ + class Region implements IRegion { + + /** + * Constructs a new Region. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IRegion); + + /** Region name. */ + public name: string; + + /** Region displayName. */ + public displayName?: (string|null); + + /** Region postalCodeArea. */ + public postalCodeArea?: (google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea|null); + + /** Region geotargetArea. */ + public geotargetArea?: (google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea|null); + + /** Region regionalInventoryEligible. */ + public regionalInventoryEligible?: (google.protobuf.IBoolValue|null); + + /** Region shippingEligible. */ + public shippingEligible?: (google.protobuf.IBoolValue|null); + + /** Region _displayName. */ + public _displayName?: "displayName"; + + /** + * Creates a new Region instance using the specified properties. + * @param [properties] Properties to set + * @returns Region instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IRegion): google.shopping.merchant.accounts.v1beta.Region; + + /** + * Encodes the specified Region message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.verify|verify} messages. + * @param message Region message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IRegion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Region message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.verify|verify} messages. + * @param message Region message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRegion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Region message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Region + * @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.Region; + + /** + * Decodes a Region message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Region + * @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.Region; + + /** + * Verifies a Region 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 Region message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Region + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Region; + + /** + * Creates a plain object from a Region message. Also converts values to other types if specified. + * @param message Region + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Region, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Region to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Region + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Region { + + /** Properties of a PostalCodeArea. */ + interface IPostalCodeArea { + + /** PostalCodeArea regionCode */ + regionCode?: (string|null); + + /** PostalCodeArea postalCodes */ + postalCodes?: (google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange[]|null); + } + + /** Represents a PostalCodeArea. */ + class PostalCodeArea implements IPostalCodeArea { + + /** + * Constructs a new PostalCodeArea. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea); + + /** PostalCodeArea regionCode. */ + public regionCode: string; + + /** PostalCodeArea postalCodes. */ + public postalCodes: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange[]; + + /** + * Creates a new PostalCodeArea instance using the specified properties. + * @param [properties] Properties to set + * @returns PostalCodeArea instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea): google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea; + + /** + * Encodes the specified PostalCodeArea message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify|verify} messages. + * @param message PostalCodeArea message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostalCodeArea message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify|verify} messages. + * @param message PostalCodeArea message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostalCodeArea message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostalCodeArea + * @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.Region.PostalCodeArea; + + /** + * Decodes a PostalCodeArea message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostalCodeArea + * @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.Region.PostalCodeArea; + + /** + * Verifies a PostalCodeArea 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 PostalCodeArea message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostalCodeArea + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea; + + /** + * Creates a plain object from a PostalCodeArea message. Also converts values to other types if specified. + * @param message PostalCodeArea + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostalCodeArea to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostalCodeArea + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PostalCodeArea { + + /** Properties of a PostalCodeRange. */ + interface IPostalCodeRange { + + /** PostalCodeRange begin */ + begin?: (string|null); + + /** PostalCodeRange end */ + end?: (string|null); + } + + /** Represents a PostalCodeRange. */ + class PostalCodeRange implements IPostalCodeRange { + + /** + * Constructs a new PostalCodeRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange); + + /** PostalCodeRange begin. */ + public begin: string; + + /** PostalCodeRange end. */ + public end: string; + + /** + * Creates a new PostalCodeRange instance using the specified properties. + * @param [properties] Properties to set + * @returns PostalCodeRange instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange): google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange; + + /** + * Encodes the specified PostalCodeRange message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify|verify} messages. + * @param message PostalCodeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostalCodeRange message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify|verify} messages. + * @param message PostalCodeRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostalCodeRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostalCodeRange + * @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.Region.PostalCodeArea.PostalCodeRange; + + /** + * Decodes a PostalCodeRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostalCodeRange + * @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.Region.PostalCodeArea.PostalCodeRange; + + /** + * Verifies a PostalCodeRange 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 PostalCodeRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostalCodeRange + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange; + + /** + * Creates a plain object from a PostalCodeRange message. Also converts values to other types if specified. + * @param message PostalCodeRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostalCodeRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostalCodeRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeoTargetArea. */ + interface IGeoTargetArea { + + /** GeoTargetArea geotargetCriteriaIds */ + geotargetCriteriaIds?: ((number|Long|string)[]|null); + } + + /** Represents a GeoTargetArea. */ + class GeoTargetArea implements IGeoTargetArea { + + /** + * Constructs a new GeoTargetArea. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea); + + /** GeoTargetArea geotargetCriteriaIds. */ + public geotargetCriteriaIds: (number|Long|string)[]; + + /** + * Creates a new GeoTargetArea instance using the specified properties. + * @param [properties] Properties to set + * @returns GeoTargetArea instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea): google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea; + + /** + * Encodes the specified GeoTargetArea message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify|verify} messages. + * @param message GeoTargetArea message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeoTargetArea message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify|verify} messages. + * @param message GeoTargetArea message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeoTargetArea message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeoTargetArea + * @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.Region.GeoTargetArea; + + /** + * Decodes a GeoTargetArea message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeoTargetArea + * @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.Region.GeoTargetArea; + + /** + * Verifies a GeoTargetArea 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 GeoTargetArea message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeoTargetArea + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea; + + /** + * Creates a plain object from a GeoTargetArea message. Also converts values to other types if specified. + * @param message GeoTargetArea + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeoTargetArea to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeoTargetArea + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a ShippingSettingsService */ + class ShippingSettingsService extends $protobuf.rpc.Service { + + /** + * Constructs a new ShippingSettingsService 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 ShippingSettingsService 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): ShippingSettingsService; + + /** + * Calls GetShippingSettings. + * @param request GetShippingSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ShippingSettings + */ + public getShippingSettings(request: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, callback: google.shopping.merchant.accounts.v1beta.ShippingSettingsService.GetShippingSettingsCallback): void; + + /** + * Calls GetShippingSettings. + * @param request GetShippingSettingsRequest message or plain object + * @returns Promise + */ + public getShippingSettings(request: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest): Promise; + + /** + * Calls InsertShippingSettings. + * @param request InsertShippingSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ShippingSettings + */ + public insertShippingSettings(request: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, callback: google.shopping.merchant.accounts.v1beta.ShippingSettingsService.InsertShippingSettingsCallback): void; + + /** + * Calls InsertShippingSettings. + * @param request InsertShippingSettingsRequest message or plain object + * @returns Promise + */ + public insertShippingSettings(request: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest): Promise; + } + + namespace ShippingSettingsService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ShippingSettingsService|getShippingSettings}. + * @param error Error, if any + * @param [response] ShippingSettings + */ + type GetShippingSettingsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ShippingSettings) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ShippingSettingsService|insertShippingSettings}. + * @param error Error, if any + * @param [response] ShippingSettings + */ + type InsertShippingSettingsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ShippingSettings) => void; + } + + /** Properties of a ShippingSettings. */ + interface IShippingSettings { + + /** ShippingSettings name */ + name?: (string|null); + + /** ShippingSettings services */ + services?: (google.shopping.merchant.accounts.v1beta.IService[]|null); + + /** ShippingSettings warehouses */ + warehouses?: (google.shopping.merchant.accounts.v1beta.IWarehouse[]|null); + + /** ShippingSettings etag */ + etag?: (string|null); + } + + /** Represents a ShippingSettings. */ + class ShippingSettings implements IShippingSettings { + + /** + * Constructs a new ShippingSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IShippingSettings); + + /** ShippingSettings name. */ + public name: string; + + /** ShippingSettings services. */ + public services: google.shopping.merchant.accounts.v1beta.IService[]; + + /** ShippingSettings warehouses. */ + public warehouses: google.shopping.merchant.accounts.v1beta.IWarehouse[]; + + /** ShippingSettings etag. */ + public etag: string; + + /** + * Creates a new ShippingSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ShippingSettings instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IShippingSettings): google.shopping.merchant.accounts.v1beta.ShippingSettings; + + /** + * Encodes the specified ShippingSettings message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ShippingSettings.verify|verify} messages. + * @param message ShippingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IShippingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShippingSettings message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ShippingSettings.verify|verify} messages. + * @param message ShippingSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IShippingSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShippingSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShippingSettings + * @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.ShippingSettings; + + /** + * Decodes a ShippingSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShippingSettings + * @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.ShippingSettings; + + /** + * Verifies a ShippingSettings 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 ShippingSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShippingSettings + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ShippingSettings; + + /** + * Creates a plain object from a ShippingSettings message. Also converts values to other types if specified. + * @param message ShippingSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.ShippingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShippingSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShippingSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Service. */ + interface IService { + + /** Service serviceName */ + serviceName?: (string|null); + + /** Service active */ + active?: (boolean|null); + + /** Service deliveryCountries */ + deliveryCountries?: (string[]|null); + + /** Service currencyCode */ + currencyCode?: (string|null); + + /** Service deliveryTime */ + deliveryTime?: (google.shopping.merchant.accounts.v1beta.IDeliveryTime|null); + + /** Service rateGroups */ + rateGroups?: (google.shopping.merchant.accounts.v1beta.IRateGroup[]|null); + + /** Service shipmentType */ + shipmentType?: (google.shopping.merchant.accounts.v1beta.Service.ShipmentType|keyof typeof google.shopping.merchant.accounts.v1beta.Service.ShipmentType|null); + + /** Service minimumOrderValue */ + minimumOrderValue?: (google.shopping.type.IPrice|null); + + /** Service minimumOrderValueTable */ + minimumOrderValueTable?: (google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable|null); + + /** Service storeConfig */ + storeConfig?: (google.shopping.merchant.accounts.v1beta.Service.IStoreConfig|null); + + /** Service loyaltyPrograms */ + loyaltyPrograms?: (google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram[]|null); + } + + /** Represents a Service. */ + class Service implements IService { + + /** + * Constructs a new Service. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IService); + + /** Service serviceName. */ + public serviceName?: (string|null); + + /** Service active. */ + public active?: (boolean|null); + + /** Service deliveryCountries. */ + public deliveryCountries: string[]; + + /** Service currencyCode. */ + public currencyCode?: (string|null); + + /** Service deliveryTime. */ + public deliveryTime?: (google.shopping.merchant.accounts.v1beta.IDeliveryTime|null); + + /** Service rateGroups. */ + public rateGroups: google.shopping.merchant.accounts.v1beta.IRateGroup[]; + + /** Service shipmentType. */ + public shipmentType?: (google.shopping.merchant.accounts.v1beta.Service.ShipmentType|keyof typeof google.shopping.merchant.accounts.v1beta.Service.ShipmentType|null); + + /** Service minimumOrderValue. */ + public minimumOrderValue?: (google.shopping.type.IPrice|null); + + /** Service minimumOrderValueTable. */ + public minimumOrderValueTable?: (google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable|null); + + /** Service storeConfig. */ + public storeConfig?: (google.shopping.merchant.accounts.v1beta.Service.IStoreConfig|null); + + /** Service loyaltyPrograms. */ + public loyaltyPrograms: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram[]; + + /** Service _serviceName. */ + public _serviceName?: "serviceName"; + + /** Service _active. */ + public _active?: "active"; + + /** Service _currencyCode. */ + public _currencyCode?: "currencyCode"; + + /** Service _deliveryTime. */ + public _deliveryTime?: "deliveryTime"; + + /** Service _shipmentType. */ + public _shipmentType?: "shipmentType"; + + /** Service _minimumOrderValue. */ + public _minimumOrderValue?: "minimumOrderValue"; + + /** Service _minimumOrderValueTable. */ + public _minimumOrderValueTable?: "minimumOrderValueTable"; + + /** Service _storeConfig. */ + public _storeConfig?: "storeConfig"; + + /** + * Creates a new Service instance using the specified properties. + * @param [properties] Properties to set + * @returns Service instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IService): google.shopping.merchant.accounts.v1beta.Service; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.verify|verify} messages. + * @param message Service message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.verify|verify} messages. + * @param message Service message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Service message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Service + * @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.Service; + + /** + * Decodes a Service message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Service + * @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.Service; + + /** + * Verifies a Service 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 Service message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Service + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service; + + /** + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @param message Service + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Service, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Service to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Service + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Service { + + /** Properties of a StoreConfig. */ + interface IStoreConfig { + + /** StoreConfig storeServiceType */ + storeServiceType?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|keyof typeof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|null); + + /** StoreConfig storeCodes */ + storeCodes?: (string[]|null); + + /** StoreConfig cutoffConfig */ + cutoffConfig?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig|null); + + /** StoreConfig serviceRadius */ + serviceRadius?: (google.shopping.merchant.accounts.v1beta.IDistance|null); + } + + /** Represents a StoreConfig. */ + class StoreConfig implements IStoreConfig { + + /** + * Constructs a new StoreConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.IStoreConfig); + + /** StoreConfig storeServiceType. */ + public storeServiceType?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|keyof typeof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|null); + + /** StoreConfig storeCodes. */ + public storeCodes: string[]; + + /** StoreConfig cutoffConfig. */ + public cutoffConfig?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig|null); + + /** StoreConfig serviceRadius. */ + public serviceRadius?: (google.shopping.merchant.accounts.v1beta.IDistance|null); + + /** StoreConfig _storeServiceType. */ + public _storeServiceType?: "storeServiceType"; + + /** StoreConfig _cutoffConfig. */ + public _cutoffConfig?: "cutoffConfig"; + + /** StoreConfig _serviceRadius. */ + public _serviceRadius?: "serviceRadius"; + + /** + * Creates a new StoreConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StoreConfig instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.IStoreConfig): google.shopping.merchant.accounts.v1beta.Service.StoreConfig; + + /** + * Encodes the specified StoreConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify|verify} messages. + * @param message StoreConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.Service.IStoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoreConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify|verify} messages. + * @param message StoreConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.IStoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoreConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoreConfig + * @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.Service.StoreConfig; + + /** + * Decodes a StoreConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoreConfig + * @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.Service.StoreConfig; + + /** + * Verifies a StoreConfig 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 StoreConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoreConfig + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.StoreConfig; + + /** + * Creates a plain object from a StoreConfig message. Also converts values to other types if specified. + * @param message StoreConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoreConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StoreConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StoreConfig { + + /** Properties of a CutoffConfig. */ + interface ICutoffConfig { + + /** CutoffConfig localCutoffTime */ + localCutoffTime?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime|null); + + /** CutoffConfig storeCloseOffsetHours */ + storeCloseOffsetHours?: (number|Long|string|null); + + /** CutoffConfig noDeliveryPostCutoff */ + noDeliveryPostCutoff?: (boolean|null); + } + + /** Represents a CutoffConfig. */ + class CutoffConfig implements ICutoffConfig { + + /** + * Constructs a new CutoffConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig); + + /** CutoffConfig localCutoffTime. */ + public localCutoffTime?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime|null); + + /** CutoffConfig storeCloseOffsetHours. */ + public storeCloseOffsetHours?: (number|Long|string|null); + + /** CutoffConfig noDeliveryPostCutoff. */ + public noDeliveryPostCutoff?: (boolean|null); + + /** CutoffConfig _localCutoffTime. */ + public _localCutoffTime?: "localCutoffTime"; + + /** CutoffConfig _storeCloseOffsetHours. */ + public _storeCloseOffsetHours?: "storeCloseOffsetHours"; + + /** CutoffConfig _noDeliveryPostCutoff. */ + public _noDeliveryPostCutoff?: "noDeliveryPostCutoff"; + + /** + * Creates a new CutoffConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CutoffConfig instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig): google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig; + + /** + * Encodes the specified CutoffConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify|verify} messages. + * @param message CutoffConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CutoffConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify|verify} messages. + * @param message CutoffConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CutoffConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CutoffConfig + * @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.Service.StoreConfig.CutoffConfig; + + /** + * Decodes a CutoffConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CutoffConfig + * @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.Service.StoreConfig.CutoffConfig; + + /** + * Verifies a CutoffConfig 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 CutoffConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CutoffConfig + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig; + + /** + * Creates a plain object from a CutoffConfig message. Also converts values to other types if specified. + * @param message CutoffConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CutoffConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CutoffConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CutoffConfig { + + /** Properties of a LocalCutoffTime. */ + interface ILocalCutoffTime { + + /** LocalCutoffTime hour */ + hour?: (number|Long|string|null); + + /** LocalCutoffTime minute */ + minute?: (number|Long|string|null); + } + + /** Represents a LocalCutoffTime. */ + class LocalCutoffTime implements ILocalCutoffTime { + + /** + * Constructs a new LocalCutoffTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime); + + /** LocalCutoffTime hour. */ + public hour?: (number|Long|string|null); + + /** LocalCutoffTime minute. */ + public minute?: (number|Long|string|null); + + /** LocalCutoffTime _hour. */ + public _hour?: "hour"; + + /** LocalCutoffTime _minute. */ + public _minute?: "minute"; + + /** + * Creates a new LocalCutoffTime instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalCutoffTime instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime): google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime; + + /** + * Encodes the specified LocalCutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify|verify} messages. + * @param message LocalCutoffTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify|verify} messages. + * @param message LocalCutoffTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalCutoffTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalCutoffTime + * @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.Service.StoreConfig.CutoffConfig.LocalCutoffTime; + + /** + * Decodes a LocalCutoffTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalCutoffTime + * @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.Service.StoreConfig.CutoffConfig.LocalCutoffTime; + + /** + * Verifies a LocalCutoffTime 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 LocalCutoffTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalCutoffTime + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime; + + /** + * Creates a plain object from a LocalCutoffTime message. Also converts values to other types if specified. + * @param message LocalCutoffTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalCutoffTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocalCutoffTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** StoreServiceType enum. */ + enum StoreServiceType { + STORE_SERVICE_TYPE_UNSPECIFIED = 0, + ALL_STORES = 1, + SELECTED_STORES = 2 + } + } + + /** Properties of a LoyaltyProgram. */ + interface ILoyaltyProgram { + + /** LoyaltyProgram programLabel */ + programLabel?: (string|null); + + /** LoyaltyProgram loyaltyProgramTiers */ + loyaltyProgramTiers?: (google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers[]|null); + } + + /** Represents a LoyaltyProgram. */ + class LoyaltyProgram implements ILoyaltyProgram { + + /** + * Constructs a new LoyaltyProgram. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram); + + /** LoyaltyProgram programLabel. */ + public programLabel?: (string|null); + + /** LoyaltyProgram loyaltyProgramTiers. */ + public loyaltyProgramTiers: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers[]; + + /** LoyaltyProgram _programLabel. */ + public _programLabel?: "programLabel"; + + /** + * Creates a new LoyaltyProgram instance using the specified properties. + * @param [properties] Properties to set + * @returns LoyaltyProgram instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram): google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram; + + /** + * Encodes the specified LoyaltyProgram message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify|verify} messages. + * @param message LoyaltyProgram message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoyaltyProgram message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify|verify} messages. + * @param message LoyaltyProgram message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoyaltyProgram message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoyaltyProgram + * @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.Service.LoyaltyProgram; + + /** + * Decodes a LoyaltyProgram message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoyaltyProgram + * @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.Service.LoyaltyProgram; + + /** + * Verifies a LoyaltyProgram 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 LoyaltyProgram message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoyaltyProgram + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram; + + /** + * Creates a plain object from a LoyaltyProgram message. Also converts values to other types if specified. + * @param message LoyaltyProgram + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoyaltyProgram to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoyaltyProgram + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LoyaltyProgram { + + /** Properties of a LoyaltyProgramTiers. */ + interface ILoyaltyProgramTiers { + + /** LoyaltyProgramTiers tierLabel */ + tierLabel?: (string|null); + } + + /** Represents a LoyaltyProgramTiers. */ + class LoyaltyProgramTiers implements ILoyaltyProgramTiers { + + /** + * Constructs a new LoyaltyProgramTiers. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers); + + /** LoyaltyProgramTiers tierLabel. */ + public tierLabel?: (string|null); + + /** LoyaltyProgramTiers _tierLabel. */ + public _tierLabel?: "tierLabel"; + + /** + * Creates a new LoyaltyProgramTiers instance using the specified properties. + * @param [properties] Properties to set + * @returns LoyaltyProgramTiers instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers): google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers; + + /** + * Encodes the specified LoyaltyProgramTiers message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify|verify} messages. + * @param message LoyaltyProgramTiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoyaltyProgramTiers message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify|verify} messages. + * @param message LoyaltyProgramTiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoyaltyProgramTiers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoyaltyProgramTiers + * @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.Service.LoyaltyProgram.LoyaltyProgramTiers; + + /** + * Decodes a LoyaltyProgramTiers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoyaltyProgramTiers + * @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.Service.LoyaltyProgram.LoyaltyProgramTiers; + + /** + * Verifies a LoyaltyProgramTiers 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 LoyaltyProgramTiers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoyaltyProgramTiers + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers; + + /** + * Creates a plain object from a LoyaltyProgramTiers message. Also converts values to other types if specified. + * @param message LoyaltyProgramTiers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoyaltyProgramTiers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoyaltyProgramTiers + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ShipmentType enum. */ + enum ShipmentType { + SHIPMENT_TYPE_UNSPECIFIED = 0, + DELIVERY = 1, + LOCAL_DELIVERY = 2, + COLLECTION_POINT = 3 + } + } + + /** Properties of a Distance. */ + interface IDistance { + + /** Distance value */ + value?: (number|Long|string|null); + + /** Distance unit */ + unit?: (google.shopping.merchant.accounts.v1beta.Distance.Unit|keyof typeof google.shopping.merchant.accounts.v1beta.Distance.Unit|null); + } + + /** Represents a Distance. */ + class Distance implements IDistance { + + /** + * Constructs a new Distance. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IDistance); + + /** Distance value. */ + public value?: (number|Long|string|null); + + /** Distance unit. */ + public unit?: (google.shopping.merchant.accounts.v1beta.Distance.Unit|keyof typeof google.shopping.merchant.accounts.v1beta.Distance.Unit|null); + + /** Distance _value. */ + public _value?: "value"; + + /** Distance _unit. */ + public _unit?: "unit"; + + /** + * Creates a new Distance instance using the specified properties. + * @param [properties] Properties to set + * @returns Distance instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IDistance): google.shopping.merchant.accounts.v1beta.Distance; + + /** + * Encodes the specified Distance message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Distance.verify|verify} messages. + * @param message Distance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IDistance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Distance message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Distance.verify|verify} messages. + * @param message Distance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDistance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Distance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Distance + * @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.Distance; + + /** + * Decodes a Distance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Distance + * @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.Distance; + + /** + * Verifies a Distance 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 Distance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Distance + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Distance; + + /** + * Creates a plain object from a Distance message. Also converts values to other types if specified. + * @param message Distance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Distance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Distance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Distance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Distance { + + /** Unit enum. */ + enum Unit { + UNIT_UNSPECIFIED = 0, + MILES = 1, + KILOMETERS = 2 + } + } + + /** Properties of a Warehouse. */ + interface IWarehouse { + + /** Warehouse name */ + name?: (string|null); + + /** Warehouse shippingAddress */ + shippingAddress?: (google.shopping.merchant.accounts.v1beta.IAddress|null); + + /** Warehouse cutoffTime */ + cutoffTime?: (google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime|null); + + /** Warehouse handlingDays */ + handlingDays?: (number|Long|string|null); + + /** Warehouse businessDayConfig */ + businessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); + } + + /** Represents a Warehouse. */ + class Warehouse implements IWarehouse { + + /** + * Constructs a new Warehouse. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IWarehouse); + + /** Warehouse name. */ + public name?: (string|null); + + /** Warehouse shippingAddress. */ + public shippingAddress?: (google.shopping.merchant.accounts.v1beta.IAddress|null); + + /** Warehouse cutoffTime. */ + public cutoffTime?: (google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime|null); + + /** Warehouse handlingDays. */ + public handlingDays?: (number|Long|string|null); + + /** Warehouse businessDayConfig. */ + public businessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); + + /** Warehouse _name. */ + public _name?: "name"; + + /** Warehouse _shippingAddress. */ + public _shippingAddress?: "shippingAddress"; + + /** Warehouse _cutoffTime. */ + public _cutoffTime?: "cutoffTime"; + + /** Warehouse _handlingDays. */ + public _handlingDays?: "handlingDays"; + + /** Warehouse _businessDayConfig. */ + public _businessDayConfig?: "businessDayConfig"; + + /** + * Creates a new Warehouse instance using the specified properties. + * @param [properties] Properties to set + * @returns Warehouse instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IWarehouse): google.shopping.merchant.accounts.v1beta.Warehouse; + + /** + * Encodes the specified Warehouse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Warehouse.verify|verify} messages. + * @param message Warehouse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IWarehouse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Warehouse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Warehouse.verify|verify} messages. + * @param message Warehouse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IWarehouse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Warehouse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Warehouse + * @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.Warehouse; + + /** + * Decodes a Warehouse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Warehouse + * @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.Warehouse; + + /** + * Verifies a Warehouse 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 Warehouse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Warehouse + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Warehouse; + + /** + * Creates a plain object from a Warehouse message. Also converts values to other types if specified. + * @param message Warehouse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Warehouse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Warehouse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Warehouse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WarehouseCutoffTime. */ + interface IWarehouseCutoffTime { + + /** WarehouseCutoffTime hour */ + hour?: (number|null); + + /** WarehouseCutoffTime minute */ + minute?: (number|null); + } + + /** Represents a WarehouseCutoffTime. */ + class WarehouseCutoffTime implements IWarehouseCutoffTime { + + /** + * Constructs a new WarehouseCutoffTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime); + + /** WarehouseCutoffTime hour. */ + public hour?: (number|null); + + /** WarehouseCutoffTime minute. */ + public minute?: (number|null); + + /** WarehouseCutoffTime _hour. */ + public _hour?: "hour"; + + /** WarehouseCutoffTime _minute. */ + public _minute?: "minute"; + + /** + * Creates a new WarehouseCutoffTime instance using the specified properties. + * @param [properties] Properties to set + * @returns WarehouseCutoffTime instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime): google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime; + + /** + * Encodes the specified WarehouseCutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify|verify} messages. + * @param message WarehouseCutoffTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WarehouseCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify|verify} messages. + * @param message WarehouseCutoffTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WarehouseCutoffTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WarehouseCutoffTime + * @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.WarehouseCutoffTime; + + /** + * Decodes a WarehouseCutoffTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WarehouseCutoffTime + * @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.WarehouseCutoffTime; + + /** + * Verifies a WarehouseCutoffTime 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 WarehouseCutoffTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WarehouseCutoffTime + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime; + + /** + * Creates a plain object from a WarehouseCutoffTime message. Also converts values to other types if specified. + * @param message WarehouseCutoffTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WarehouseCutoffTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WarehouseCutoffTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Address. */ + interface IAddress { + + /** Address streetAddress */ + streetAddress?: (string|null); + + /** Address city */ + city?: (string|null); + + /** Address administrativeArea */ + administrativeArea?: (string|null); + + /** Address postalCode */ + postalCode?: (string|null); + + /** Address regionCode */ + regionCode?: (string|null); + } + + /** Represents an Address. */ + class Address implements IAddress { + + /** + * Constructs a new Address. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IAddress); + + /** Address streetAddress. */ + public streetAddress?: (string|null); + + /** Address city. */ + public city?: (string|null); + + /** Address administrativeArea. */ + public administrativeArea?: (string|null); + + /** Address postalCode. */ + public postalCode?: (string|null); + + /** Address regionCode. */ + public regionCode?: (string|null); + + /** Address _streetAddress. */ + public _streetAddress?: "streetAddress"; + + /** Address _city. */ + public _city?: "city"; + + /** Address _administrativeArea. */ + public _administrativeArea?: "administrativeArea"; + + /** Address _postalCode. */ + public _postalCode?: "postalCode"; + + /** Address _regionCode. */ + public _regionCode?: "regionCode"; + + /** + * Creates a new Address instance using the specified properties. + * @param [properties] Properties to set + * @returns Address instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IAddress): google.shopping.merchant.accounts.v1beta.Address; + + /** + * Encodes the specified Address message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Address.verify|verify} messages. + * @param message Address message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Address message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Address.verify|verify} messages. + * @param message Address message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Address message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Address + * @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.Address; + + /** + * Decodes an Address message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Address + * @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.Address; + + /** + * Verifies an Address 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 Address message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Address + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Address; + + /** + * Creates a plain object from an Address message. Also converts values to other types if specified. + * @param message Address + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Address, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Address to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Address + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeliveryTime. */ + interface IDeliveryTime { + + /** DeliveryTime minTransitDays */ + minTransitDays?: (number|null); + + /** DeliveryTime maxTransitDays */ + maxTransitDays?: (number|null); + + /** DeliveryTime cutoffTime */ + cutoffTime?: (google.shopping.merchant.accounts.v1beta.ICutoffTime|null); + + /** DeliveryTime minHandlingDays */ + minHandlingDays?: (number|null); + + /** DeliveryTime maxHandlingDays */ + maxHandlingDays?: (number|null); + + /** DeliveryTime transitTimeTable */ + transitTimeTable?: (google.shopping.merchant.accounts.v1beta.ITransitTable|null); + + /** DeliveryTime handlingBusinessDayConfig */ + handlingBusinessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); + + /** DeliveryTime transitBusinessDayConfig */ + transitBusinessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); + + /** DeliveryTime warehouseBasedDeliveryTimes */ + warehouseBasedDeliveryTimes?: (google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime[]|null); + } + + /** Represents a DeliveryTime. */ + class DeliveryTime implements IDeliveryTime { + + /** + * Constructs a new DeliveryTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IDeliveryTime); + + /** DeliveryTime minTransitDays. */ + public minTransitDays?: (number|null); + + /** DeliveryTime maxTransitDays. */ + public maxTransitDays?: (number|null); + + /** DeliveryTime cutoffTime. */ + public cutoffTime?: (google.shopping.merchant.accounts.v1beta.ICutoffTime|null); + + /** DeliveryTime minHandlingDays. */ + public minHandlingDays?: (number|null); + + /** DeliveryTime maxHandlingDays. */ + public maxHandlingDays?: (number|null); + + /** DeliveryTime transitTimeTable. */ + public transitTimeTable?: (google.shopping.merchant.accounts.v1beta.ITransitTable|null); + + /** DeliveryTime handlingBusinessDayConfig. */ + public handlingBusinessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); + + /** DeliveryTime transitBusinessDayConfig. */ + public transitBusinessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); + + /** DeliveryTime warehouseBasedDeliveryTimes. */ + public warehouseBasedDeliveryTimes: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime[]; + + /** DeliveryTime _minTransitDays. */ + public _minTransitDays?: "minTransitDays"; + + /** DeliveryTime _maxTransitDays. */ + public _maxTransitDays?: "maxTransitDays"; + + /** DeliveryTime _cutoffTime. */ + public _cutoffTime?: "cutoffTime"; + + /** DeliveryTime _minHandlingDays. */ + public _minHandlingDays?: "minHandlingDays"; + + /** DeliveryTime _maxHandlingDays. */ + public _maxHandlingDays?: "maxHandlingDays"; + + /** DeliveryTime _transitTimeTable. */ + public _transitTimeTable?: "transitTimeTable"; + + /** DeliveryTime _handlingBusinessDayConfig. */ + public _handlingBusinessDayConfig?: "handlingBusinessDayConfig"; + + /** DeliveryTime _transitBusinessDayConfig. */ + public _transitBusinessDayConfig?: "transitBusinessDayConfig"; + + /** + * Creates a new DeliveryTime instance using the specified properties. + * @param [properties] Properties to set + * @returns DeliveryTime instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IDeliveryTime): google.shopping.merchant.accounts.v1beta.DeliveryTime; + + /** + * Encodes the specified DeliveryTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeliveryTime.verify|verify} messages. + * @param message DeliveryTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IDeliveryTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeliveryTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeliveryTime.verify|verify} messages. + * @param message DeliveryTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDeliveryTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeliveryTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeliveryTime + * @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.DeliveryTime; + + /** + * Decodes a DeliveryTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeliveryTime + * @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.DeliveryTime; + + /** + * Verifies a DeliveryTime 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 DeliveryTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeliveryTime + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DeliveryTime; + + /** + * Creates a plain object from a DeliveryTime message. Also converts values to other types if specified. + * @param message DeliveryTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.DeliveryTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeliveryTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeliveryTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CutoffTime. */ + interface ICutoffTime { + + /** CutoffTime hour */ + hour?: (number|null); + + /** CutoffTime minute */ + minute?: (number|null); + + /** CutoffTime timeZone */ + timeZone?: (string|null); + } + + /** Represents a CutoffTime. */ + class CutoffTime implements ICutoffTime { + + /** + * Constructs a new CutoffTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ICutoffTime); + + /** CutoffTime hour. */ + public hour?: (number|null); + + /** CutoffTime minute. */ + public minute?: (number|null); + + /** CutoffTime timeZone. */ + public timeZone?: (string|null); + + /** CutoffTime _hour. */ + public _hour?: "hour"; + + /** CutoffTime _minute. */ + public _minute?: "minute"; + + /** CutoffTime _timeZone. */ + public _timeZone?: "timeZone"; + + /** + * Creates a new CutoffTime instance using the specified properties. + * @param [properties] Properties to set + * @returns CutoffTime instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ICutoffTime): google.shopping.merchant.accounts.v1beta.CutoffTime; + + /** + * Encodes the specified CutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CutoffTime.verify|verify} messages. + * @param message CutoffTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ICutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CutoffTime.verify|verify} messages. + * @param message CutoffTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CutoffTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CutoffTime + * @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.CutoffTime; + + /** + * Decodes a CutoffTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CutoffTime + * @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.CutoffTime; + + /** + * Verifies a CutoffTime 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 CutoffTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CutoffTime + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CutoffTime; + + /** + * Creates a plain object from a CutoffTime message. Also converts values to other types if specified. + * @param message CutoffTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.CutoffTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CutoffTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CutoffTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BusinessDayConfig. */ + interface IBusinessDayConfig { + + /** BusinessDayConfig businessDays */ + businessDays?: (google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday[]|null); + } + + /** Represents a BusinessDayConfig. */ + class BusinessDayConfig implements IBusinessDayConfig { + + /** + * Constructs a new BusinessDayConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IBusinessDayConfig); + + /** BusinessDayConfig businessDays. */ + public businessDays: google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday[]; + + /** + * Creates a new BusinessDayConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BusinessDayConfig instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IBusinessDayConfig): google.shopping.merchant.accounts.v1beta.BusinessDayConfig; + + /** + * Encodes the specified BusinessDayConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify|verify} messages. + * @param message BusinessDayConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IBusinessDayConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BusinessDayConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify|verify} messages. + * @param message BusinessDayConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IBusinessDayConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BusinessDayConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BusinessDayConfig + * @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.BusinessDayConfig; + + /** + * Decodes a BusinessDayConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BusinessDayConfig + * @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.BusinessDayConfig; + + /** + * Verifies a BusinessDayConfig 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 BusinessDayConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BusinessDayConfig + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.BusinessDayConfig; + + /** + * Creates a plain object from a BusinessDayConfig message. Also converts values to other types if specified. + * @param message BusinessDayConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.BusinessDayConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BusinessDayConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BusinessDayConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BusinessDayConfig { + + /** Weekday enum. */ + enum Weekday { + WEEKDAY_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + } + + /** Properties of a WarehouseBasedDeliveryTime. */ + interface IWarehouseBasedDeliveryTime { + + /** WarehouseBasedDeliveryTime carrier */ + carrier?: (string|null); + + /** WarehouseBasedDeliveryTime carrierService */ + carrierService?: (string|null); + + /** WarehouseBasedDeliveryTime warehouse */ + warehouse?: (string|null); + } + + /** Represents a WarehouseBasedDeliveryTime. */ + class WarehouseBasedDeliveryTime implements IWarehouseBasedDeliveryTime { + + /** + * Constructs a new WarehouseBasedDeliveryTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime); + + /** WarehouseBasedDeliveryTime carrier. */ + public carrier?: (string|null); + + /** WarehouseBasedDeliveryTime carrierService. */ + public carrierService?: (string|null); + + /** WarehouseBasedDeliveryTime warehouse. */ + public warehouse?: (string|null); + + /** WarehouseBasedDeliveryTime _carrier. */ + public _carrier?: "carrier"; + + /** WarehouseBasedDeliveryTime _carrierService. */ + public _carrierService?: "carrierService"; + + /** WarehouseBasedDeliveryTime _warehouse. */ + public _warehouse?: "warehouse"; + + /** + * Creates a new WarehouseBasedDeliveryTime instance using the specified properties. + * @param [properties] Properties to set + * @returns WarehouseBasedDeliveryTime instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime): google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime; + + /** + * Encodes the specified WarehouseBasedDeliveryTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify|verify} messages. + * @param message WarehouseBasedDeliveryTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WarehouseBasedDeliveryTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify|verify} messages. + * @param message WarehouseBasedDeliveryTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WarehouseBasedDeliveryTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WarehouseBasedDeliveryTime + * @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.WarehouseBasedDeliveryTime; + + /** + * Decodes a WarehouseBasedDeliveryTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WarehouseBasedDeliveryTime + * @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.WarehouseBasedDeliveryTime; + + /** + * Verifies a WarehouseBasedDeliveryTime 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 WarehouseBasedDeliveryTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WarehouseBasedDeliveryTime + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime; + + /** + * Creates a plain object from a WarehouseBasedDeliveryTime message. Also converts values to other types if specified. + * @param message WarehouseBasedDeliveryTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WarehouseBasedDeliveryTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WarehouseBasedDeliveryTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RateGroup. */ + interface IRateGroup { + + /** RateGroup applicableShippingLabels */ + applicableShippingLabels?: (string[]|null); + + /** RateGroup singleValue */ + singleValue?: (google.shopping.merchant.accounts.v1beta.IValue|null); + + /** RateGroup mainTable */ + mainTable?: (google.shopping.merchant.accounts.v1beta.ITable|null); + + /** RateGroup subtables */ + subtables?: (google.shopping.merchant.accounts.v1beta.ITable[]|null); + + /** RateGroup carrierRates */ + carrierRates?: (google.shopping.merchant.accounts.v1beta.ICarrierRate[]|null); + + /** RateGroup name */ + name?: (string|null); + } + + /** Represents a RateGroup. */ + class RateGroup implements IRateGroup { + + /** + * Constructs a new RateGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IRateGroup); + + /** RateGroup applicableShippingLabels. */ + public applicableShippingLabels: string[]; + + /** RateGroup singleValue. */ + public singleValue?: (google.shopping.merchant.accounts.v1beta.IValue|null); + + /** RateGroup mainTable. */ + public mainTable?: (google.shopping.merchant.accounts.v1beta.ITable|null); + + /** RateGroup subtables. */ + public subtables: google.shopping.merchant.accounts.v1beta.ITable[]; + + /** RateGroup carrierRates. */ + public carrierRates: google.shopping.merchant.accounts.v1beta.ICarrierRate[]; + + /** RateGroup name. */ + public name?: (string|null); + + /** RateGroup _singleValue. */ + public _singleValue?: "singleValue"; + + /** RateGroup _mainTable. */ + public _mainTable?: "mainTable"; + + /** RateGroup _name. */ + public _name?: "name"; + + /** + * Creates a new RateGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns RateGroup instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IRateGroup): google.shopping.merchant.accounts.v1beta.RateGroup; + + /** + * Encodes the specified RateGroup message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RateGroup.verify|verify} messages. + * @param message RateGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IRateGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RateGroup message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RateGroup.verify|verify} messages. + * @param message RateGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRateGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RateGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RateGroup + * @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.RateGroup; + + /** + * Decodes a RateGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RateGroup + * @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.RateGroup; + + /** + * Verifies a RateGroup 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 RateGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RateGroup + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.RateGroup; + + /** + * Creates a plain object from a RateGroup message. Also converts values to other types if specified. + * @param message RateGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.RateGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RateGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RateGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Table. */ + interface ITable { + + /** Table name */ + name?: (string|null); + + /** Table rowHeaders */ + rowHeaders?: (google.shopping.merchant.accounts.v1beta.IHeaders|null); + + /** Table columnHeaders */ + columnHeaders?: (google.shopping.merchant.accounts.v1beta.IHeaders|null); + + /** Table rows */ + rows?: (google.shopping.merchant.accounts.v1beta.IRow[]|null); + } + + /** Represents a Table. */ + class Table implements ITable { + + /** + * Constructs a new Table. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ITable); + + /** Table name. */ + public name?: (string|null); + + /** Table rowHeaders. */ + public rowHeaders?: (google.shopping.merchant.accounts.v1beta.IHeaders|null); + + /** Table columnHeaders. */ + public columnHeaders?: (google.shopping.merchant.accounts.v1beta.IHeaders|null); + + /** Table rows. */ + public rows: google.shopping.merchant.accounts.v1beta.IRow[]; + + /** Table _name. */ + public _name?: "name"; + + /** Table _rowHeaders. */ + public _rowHeaders?: "rowHeaders"; + + /** Table _columnHeaders. */ + public _columnHeaders?: "columnHeaders"; + + /** + * Creates a new Table instance using the specified properties. + * @param [properties] Properties to set + * @returns Table instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ITable): google.shopping.merchant.accounts.v1beta.Table; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Table.verify|verify} messages. + * @param message Table message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Table message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Table + * @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.Table; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Table + * @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.Table; + + /** + * Verifies a Table 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 Table message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Table + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Table; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @param message Table + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Table to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Table + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransitTable. */ + interface ITransitTable { + + /** TransitTable postalCodeGroupNames */ + postalCodeGroupNames?: (string[]|null); + + /** TransitTable transitTimeLabels */ + transitTimeLabels?: (string[]|null); + + /** TransitTable rows */ + rows?: (google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow[]|null); + } + + /** Represents a TransitTable. */ + class TransitTable implements ITransitTable { + + /** + * Constructs a new TransitTable. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ITransitTable); + + /** TransitTable postalCodeGroupNames. */ + public postalCodeGroupNames: string[]; + + /** TransitTable transitTimeLabels. */ + public transitTimeLabels: string[]; + + /** TransitTable rows. */ + public rows: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow[]; + + /** + * Creates a new TransitTable instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitTable instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ITransitTable): google.shopping.merchant.accounts.v1beta.TransitTable; + + /** + * Encodes the specified TransitTable message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.verify|verify} messages. + * @param message TransitTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ITransitTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitTable message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.verify|verify} messages. + * @param message TransitTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITransitTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitTable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitTable + * @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.TransitTable; + + /** + * Decodes a TransitTable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitTable + * @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.TransitTable; + + /** + * Verifies a TransitTable 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 TransitTable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitTable + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TransitTable; + + /** + * Creates a plain object from a TransitTable message. Also converts values to other types if specified. + * @param message TransitTable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.TransitTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitTable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitTable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransitTable { + + /** Properties of a TransitTimeRow. */ + interface ITransitTimeRow { + + /** TransitTimeRow values */ + values?: (google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue[]|null); + } + + /** Represents a TransitTimeRow. */ + class TransitTimeRow implements ITransitTimeRow { + + /** + * Constructs a new TransitTimeRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow); + + /** TransitTimeRow values. */ + public values: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue[]; + + /** + * Creates a new TransitTimeRow instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitTimeRow instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow): google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow; + + /** + * Encodes the specified TransitTimeRow message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify|verify} messages. + * @param message TransitTimeRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitTimeRow message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify|verify} messages. + * @param message TransitTimeRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitTimeRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitTimeRow + * @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.TransitTable.TransitTimeRow; + + /** + * Decodes a TransitTimeRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitTimeRow + * @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.TransitTable.TransitTimeRow; + + /** + * Verifies a TransitTimeRow 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 TransitTimeRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitTimeRow + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow; + + /** + * Creates a plain object from a TransitTimeRow message. Also converts values to other types if specified. + * @param message TransitTimeRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitTimeRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitTimeRow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TransitTimeRow { + + /** Properties of a TransitTimeValue. */ + interface ITransitTimeValue { + + /** TransitTimeValue minTransitDays */ + minTransitDays?: (number|null); + + /** TransitTimeValue maxTransitDays */ + maxTransitDays?: (number|null); + } + + /** Represents a TransitTimeValue. */ + class TransitTimeValue implements ITransitTimeValue { + + /** + * Constructs a new TransitTimeValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue); + + /** TransitTimeValue minTransitDays. */ + public minTransitDays?: (number|null); + + /** TransitTimeValue maxTransitDays. */ + public maxTransitDays?: (number|null); + + /** TransitTimeValue _minTransitDays. */ + public _minTransitDays?: "minTransitDays"; + + /** TransitTimeValue _maxTransitDays. */ + public _maxTransitDays?: "maxTransitDays"; + + /** + * Creates a new TransitTimeValue instance using the specified properties. + * @param [properties] Properties to set + * @returns TransitTimeValue instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue): google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue; + + /** + * Encodes the specified TransitTimeValue message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify|verify} messages. + * @param message TransitTimeValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransitTimeValue message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify|verify} messages. + * @param message TransitTimeValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransitTimeValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransitTimeValue + * @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.TransitTable.TransitTimeRow.TransitTimeValue; + + /** + * Decodes a TransitTimeValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransitTimeValue + * @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.TransitTable.TransitTimeRow.TransitTimeValue; + + /** + * Verifies a TransitTimeValue 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 TransitTimeValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransitTimeValue + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue; + + /** + * Creates a plain object from a TransitTimeValue message. Also converts values to other types if specified. + * @param message TransitTimeValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransitTimeValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransitTimeValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a MinimumOrderValueTable. */ + interface IMinimumOrderValueTable { + + /** MinimumOrderValueTable storeCodeSetWithMovs */ + storeCodeSetWithMovs?: (google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov[]|null); + } + + /** Represents a MinimumOrderValueTable. */ + class MinimumOrderValueTable implements IMinimumOrderValueTable { + + /** + * Constructs a new MinimumOrderValueTable. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable); + + /** MinimumOrderValueTable storeCodeSetWithMovs. */ + public storeCodeSetWithMovs: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov[]; + + /** + * Creates a new MinimumOrderValueTable instance using the specified properties. + * @param [properties] Properties to set + * @returns MinimumOrderValueTable instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable): google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable; + + /** + * Encodes the specified MinimumOrderValueTable message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify|verify} messages. + * @param message MinimumOrderValueTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MinimumOrderValueTable message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify|verify} messages. + * @param message MinimumOrderValueTable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MinimumOrderValueTable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MinimumOrderValueTable + * @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.MinimumOrderValueTable; + + /** + * Decodes a MinimumOrderValueTable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MinimumOrderValueTable + * @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.MinimumOrderValueTable; + + /** + * Verifies a MinimumOrderValueTable 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 MinimumOrderValueTable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MinimumOrderValueTable + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable; + + /** + * Creates a plain object from a MinimumOrderValueTable message. Also converts values to other types if specified. + * @param message MinimumOrderValueTable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MinimumOrderValueTable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MinimumOrderValueTable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MinimumOrderValueTable { + + /** Properties of a StoreCodeSetWithMov. */ + interface IStoreCodeSetWithMov { + + /** StoreCodeSetWithMov storeCodes */ + storeCodes?: (string[]|null); + + /** StoreCodeSetWithMov value */ + value?: (google.shopping.type.IPrice|null); + } + + /** Represents a StoreCodeSetWithMov. */ + class StoreCodeSetWithMov implements IStoreCodeSetWithMov { + + /** + * Constructs a new StoreCodeSetWithMov. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov); + + /** StoreCodeSetWithMov storeCodes. */ + public storeCodes: string[]; + + /** StoreCodeSetWithMov value. */ + public value?: (google.shopping.type.IPrice|null); + + /** StoreCodeSetWithMov _value. */ + public _value?: "value"; + + /** + * Creates a new StoreCodeSetWithMov instance using the specified properties. + * @param [properties] Properties to set + * @returns StoreCodeSetWithMov instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov): google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov; + + /** + * Encodes the specified StoreCodeSetWithMov message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify|verify} messages. + * @param message StoreCodeSetWithMov message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StoreCodeSetWithMov message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify|verify} messages. + * @param message StoreCodeSetWithMov message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StoreCodeSetWithMov message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StoreCodeSetWithMov + * @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.MinimumOrderValueTable.StoreCodeSetWithMov; + + /** + * Decodes a StoreCodeSetWithMov message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StoreCodeSetWithMov + * @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.MinimumOrderValueTable.StoreCodeSetWithMov; + + /** + * Verifies a StoreCodeSetWithMov 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 StoreCodeSetWithMov message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StoreCodeSetWithMov + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov; + + /** + * Creates a plain object from a StoreCodeSetWithMov message. Also converts values to other types if specified. + * @param message StoreCodeSetWithMov + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StoreCodeSetWithMov to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StoreCodeSetWithMov + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Headers. */ + interface IHeaders { + + /** Headers prices */ + prices?: (google.shopping.type.IPrice[]|null); + + /** Headers weights */ + weights?: (google.shopping.type.IWeight[]|null); + + /** Headers numberOfItems */ + numberOfItems?: (string[]|null); + + /** Headers postalCodeGroupNames */ + postalCodeGroupNames?: (string[]|null); + + /** Headers locations */ + locations?: (google.shopping.merchant.accounts.v1beta.ILocationIdSet[]|null); + } + + /** Represents a Headers. */ + class Headers implements IHeaders { + + /** + * Constructs a new Headers. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IHeaders); + + /** Headers prices. */ + public prices: google.shopping.type.IPrice[]; + + /** Headers weights. */ + public weights: google.shopping.type.IWeight[]; + + /** Headers numberOfItems. */ + public numberOfItems: string[]; + + /** Headers postalCodeGroupNames. */ + public postalCodeGroupNames: string[]; + + /** Headers locations. */ + public locations: google.shopping.merchant.accounts.v1beta.ILocationIdSet[]; + + /** + * Creates a new Headers instance using the specified properties. + * @param [properties] Properties to set + * @returns Headers instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IHeaders): google.shopping.merchant.accounts.v1beta.Headers; + + /** + * Encodes the specified Headers message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Headers.verify|verify} messages. + * @param message Headers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Headers message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Headers.verify|verify} messages. + * @param message Headers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Headers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Headers + * @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.Headers; + + /** + * Decodes a Headers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Headers + * @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.Headers; + + /** + * Verifies a Headers 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 Headers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Headers + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Headers; + + /** + * Creates a plain object from a Headers message. Also converts values to other types if specified. + * @param message Headers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Headers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Headers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Headers + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LocationIdSet. */ + interface ILocationIdSet { + + /** LocationIdSet locationIds */ + locationIds?: (string[]|null); + } + + /** Represents a LocationIdSet. */ + class LocationIdSet implements ILocationIdSet { + + /** + * Constructs a new LocationIdSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ILocationIdSet); + + /** LocationIdSet locationIds. */ + public locationIds: string[]; + + /** + * Creates a new LocationIdSet instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationIdSet instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ILocationIdSet): google.shopping.merchant.accounts.v1beta.LocationIdSet; + + /** + * Encodes the specified LocationIdSet message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.LocationIdSet.verify|verify} messages. + * @param message LocationIdSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ILocationIdSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationIdSet message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.LocationIdSet.verify|verify} messages. + * @param message LocationIdSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ILocationIdSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationIdSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationIdSet + * @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.LocationIdSet; + + /** + * Decodes a LocationIdSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationIdSet + * @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.LocationIdSet; + + /** + * Verifies a LocationIdSet 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 LocationIdSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationIdSet + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.LocationIdSet; + + /** + * Creates a plain object from a LocationIdSet message. Also converts values to other types if specified. + * @param message LocationIdSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.LocationIdSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationIdSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationIdSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Row. */ + interface IRow { + + /** Row cells */ + cells?: (google.shopping.merchant.accounts.v1beta.IValue[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IRow); + + /** Row cells. */ + public cells: google.shopping.merchant.accounts.v1beta.IValue[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IRow): google.shopping.merchant.accounts.v1beta.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @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.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @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.Row; + + /** + * Verifies a Row 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 Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value noShipping */ + noShipping?: (boolean|null); + + /** Value flatRate */ + flatRate?: (google.shopping.type.IPrice|null); + + /** Value pricePercentage */ + pricePercentage?: (string|null); + + /** Value carrierRate */ + carrierRate?: (string|null); + + /** Value subtable */ + subtable?: (string|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IValue); + + /** Value noShipping. */ + public noShipping?: (boolean|null); + + /** Value flatRate. */ + public flatRate?: (google.shopping.type.IPrice|null); + + /** Value pricePercentage. */ + public pricePercentage?: (string|null); + + /** Value carrierRate. */ + public carrierRate?: (string|null); + + /** Value subtable. */ + public subtable?: (string|null); + + /** Value _noShipping. */ + public _noShipping?: "noShipping"; + + /** Value _flatRate. */ + public _flatRate?: "flatRate"; + + /** Value _pricePercentage. */ + public _pricePercentage?: "pricePercentage"; + + /** Value _carrierRate. */ + public _carrierRate?: "carrierRate"; + + /** Value _subtable. */ + public _subtable?: "subtable"; + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IValue): google.shopping.merchant.accounts.v1beta.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @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.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @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.Value; + + /** + * Verifies a Value 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 Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CarrierRate. */ + interface ICarrierRate { + + /** CarrierRate name */ + name?: (string|null); + + /** CarrierRate carrier */ + carrier?: (string|null); + + /** CarrierRate carrierService */ + carrierService?: (string|null); + + /** CarrierRate originPostalCode */ + originPostalCode?: (string|null); + + /** CarrierRate percentageAdjustment */ + percentageAdjustment?: (string|null); + + /** CarrierRate flatAdjustment */ + flatAdjustment?: (google.shopping.type.IPrice|null); + } + + /** Represents a CarrierRate. */ + class CarrierRate implements ICarrierRate { + + /** + * Constructs a new CarrierRate. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ICarrierRate); + + /** CarrierRate name. */ + public name?: (string|null); + + /** CarrierRate carrier. */ + public carrier?: (string|null); + + /** CarrierRate carrierService. */ + public carrierService?: (string|null); + + /** CarrierRate originPostalCode. */ + public originPostalCode?: (string|null); + + /** CarrierRate percentageAdjustment. */ + public percentageAdjustment?: (string|null); + + /** CarrierRate flatAdjustment. */ + public flatAdjustment?: (google.shopping.type.IPrice|null); + + /** CarrierRate _name. */ + public _name?: "name"; + + /** CarrierRate _carrier. */ + public _carrier?: "carrier"; + + /** CarrierRate _carrierService. */ + public _carrierService?: "carrierService"; + + /** CarrierRate _originPostalCode. */ + public _originPostalCode?: "originPostalCode"; + + /** CarrierRate _percentageAdjustment. */ + public _percentageAdjustment?: "percentageAdjustment"; + + /** CarrierRate _flatAdjustment. */ + public _flatAdjustment?: "flatAdjustment"; + + /** + * Creates a new CarrierRate instance using the specified properties. + * @param [properties] Properties to set + * @returns CarrierRate instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ICarrierRate): google.shopping.merchant.accounts.v1beta.CarrierRate; + + /** + * Encodes the specified CarrierRate message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CarrierRate.verify|verify} messages. + * @param message CarrierRate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ICarrierRate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CarrierRate message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CarrierRate.verify|verify} messages. + * @param message CarrierRate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICarrierRate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CarrierRate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CarrierRate + * @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.CarrierRate; + + /** + * Decodes a CarrierRate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CarrierRate + * @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.CarrierRate; + + /** + * Verifies a CarrierRate 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 CarrierRate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CarrierRate + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CarrierRate; + + /** + * Creates a plain object from a CarrierRate message. Also converts values to other types if specified. + * @param message CarrierRate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.CarrierRate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CarrierRate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CarrierRate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetShippingSettingsRequest. */ + interface IGetShippingSettingsRequest { + + /** GetShippingSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetShippingSettingsRequest. */ + class GetShippingSettingsRequest implements IGetShippingSettingsRequest { + + /** + * Constructs a new GetShippingSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest); + + /** GetShippingSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetShippingSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetShippingSettingsRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest): google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest; + + /** + * Encodes the specified GetShippingSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest.verify|verify} messages. + * @param message GetShippingSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetShippingSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest.verify|verify} messages. + * @param message GetShippingSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetShippingSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetShippingSettingsRequest + * @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.GetShippingSettingsRequest; + + /** + * Decodes a GetShippingSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetShippingSettingsRequest + * @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.GetShippingSettingsRequest; + + /** + * Verifies a GetShippingSettingsRequest 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 GetShippingSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetShippingSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest; + + /** + * Creates a plain object from a GetShippingSettingsRequest message. Also converts values to other types if specified. + * @param message GetShippingSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetShippingSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetShippingSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InsertShippingSettingsRequest. */ + interface IInsertShippingSettingsRequest { + + /** InsertShippingSettingsRequest parent */ + parent?: (string|null); + + /** InsertShippingSettingsRequest shippingSetting */ + shippingSetting?: (google.shopping.merchant.accounts.v1beta.IShippingSettings|null); + } + + /** Represents an InsertShippingSettingsRequest. */ + class InsertShippingSettingsRequest implements IInsertShippingSettingsRequest { + + /** + * Constructs a new InsertShippingSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest); + + /** InsertShippingSettingsRequest parent. */ + public parent: string; + + /** InsertShippingSettingsRequest shippingSetting. */ + public shippingSetting?: (google.shopping.merchant.accounts.v1beta.IShippingSettings|null); + + /** + * Creates a new InsertShippingSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertShippingSettingsRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest): google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest; + + /** + * Encodes the specified InsertShippingSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.verify|verify} messages. + * @param message InsertShippingSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertShippingSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.verify|verify} messages. + * @param message InsertShippingSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertShippingSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertShippingSettingsRequest + * @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.InsertShippingSettingsRequest; + + /** + * Decodes an InsertShippingSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertShippingSettingsRequest + * @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.InsertShippingSettingsRequest; + + /** + * Verifies an InsertShippingSettingsRequest 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 InsertShippingSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertShippingSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest; + + /** + * Creates a plain object from an InsertShippingSettingsRequest message. Also converts values to other types if specified. + * @param message InsertShippingSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertShippingSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InsertShippingSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TermsOfServiceService */ + class TermsOfServiceService extends $protobuf.rpc.Service { + + /** + * Constructs a new TermsOfServiceService 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 TermsOfServiceService 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): TermsOfServiceService; + + /** + * Calls GetTermsOfService. + * @param request GetTermsOfServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TermsOfService + */ + public getTermsOfService(request: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceService.GetTermsOfServiceCallback): void; + + /** + * Calls GetTermsOfService. + * @param request GetTermsOfServiceRequest message or plain object + * @returns Promise + */ + public getTermsOfService(request: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest): Promise; + + /** + * Calls RetrieveLatestTermsOfService. + * @param request RetrieveLatestTermsOfServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TermsOfService + */ + public retrieveLatestTermsOfService(request: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceService.RetrieveLatestTermsOfServiceCallback): void; + + /** + * Calls RetrieveLatestTermsOfService. + * @param request RetrieveLatestTermsOfServiceRequest message or plain object + * @returns Promise + */ + public retrieveLatestTermsOfService(request: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest): Promise; + + /** + * Calls AcceptTermsOfService. + * @param request AcceptTermsOfServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public acceptTermsOfService(request: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceService.AcceptTermsOfServiceCallback): void; + + /** + * Calls AcceptTermsOfService. + * @param request AcceptTermsOfServiceRequest message or plain object + * @returns Promise + */ + public acceptTermsOfService(request: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest): Promise; + } + + namespace TermsOfServiceService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|getTermsOfService}. + * @param error Error, if any + * @param [response] TermsOfService + */ + type GetTermsOfServiceCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.TermsOfService) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|retrieveLatestTermsOfService}. + * @param error Error, if any + * @param [response] TermsOfService + */ + type RetrieveLatestTermsOfServiceCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.TermsOfService) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|acceptTermsOfService}. + * @param error Error, if any + * @param [response] Empty + */ + type AcceptTermsOfServiceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a TermsOfService. */ + interface ITermsOfService { + + /** TermsOfService name */ + name?: (string|null); + + /** TermsOfService regionCode */ + regionCode?: (string|null); + + /** TermsOfService kind */ + kind?: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null); + + /** TermsOfService fileUri */ + fileUri?: (string|null); + + /** TermsOfService external */ + external?: (boolean|null); + } + + /** Represents a TermsOfService. */ + class TermsOfService implements ITermsOfService { + + /** + * Constructs a new TermsOfService. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ITermsOfService); + + /** TermsOfService name. */ + public name: string; + + /** TermsOfService regionCode. */ + public regionCode: string; + + /** TermsOfService kind. */ + public kind: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind); + + /** TermsOfService fileUri. */ + public fileUri?: (string|null); + + /** TermsOfService external. */ + public external: boolean; + + /** TermsOfService _fileUri. */ + public _fileUri?: "fileUri"; + + /** + * Creates a new TermsOfService instance using the specified properties. + * @param [properties] Properties to set + * @returns TermsOfService instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ITermsOfService): google.shopping.merchant.accounts.v1beta.TermsOfService; + + /** + * Encodes the specified TermsOfService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfService.verify|verify} messages. + * @param message TermsOfService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ITermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TermsOfService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfService.verify|verify} messages. + * @param message TermsOfService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TermsOfService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.shopping.merchant.accounts.v1beta.TermsOfService; + + /** + * Decodes a TermsOfService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.shopping.merchant.accounts.v1beta.TermsOfService; + + /** + * Verifies a TermsOfService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TermsOfService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TermsOfService + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TermsOfService; + + /** + * Creates a plain object from a TermsOfService message. Also converts values to other types if specified. + * @param message TermsOfService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.TermsOfService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TermsOfService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TermsOfService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTermsOfServiceRequest. */ + interface IGetTermsOfServiceRequest { + + /** GetTermsOfServiceRequest name */ + name?: (string|null); + } + + /** Represents a GetTermsOfServiceRequest. */ + class GetTermsOfServiceRequest implements IGetTermsOfServiceRequest { + + /** + * Constructs a new GetTermsOfServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest); + + /** GetTermsOfServiceRequest name. */ + public name: string; + + /** + * Creates a new GetTermsOfServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTermsOfServiceRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest): google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest; + + /** + * Encodes the specified GetTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest.verify|verify} messages. + * @param message GetTermsOfServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest.verify|verify} messages. + * @param message GetTermsOfServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTermsOfServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTermsOfServiceRequest + * @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.GetTermsOfServiceRequest; + + /** + * Decodes a GetTermsOfServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTermsOfServiceRequest + * @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.GetTermsOfServiceRequest; + + /** + * Verifies a GetTermsOfServiceRequest 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 GetTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTermsOfServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest; + + /** + * Creates a plain object from a GetTermsOfServiceRequest message. Also converts values to other types if specified. + * @param message GetTermsOfServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTermsOfServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTermsOfServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveLatestTermsOfServiceRequest. */ + interface IRetrieveLatestTermsOfServiceRequest { + + /** RetrieveLatestTermsOfServiceRequest regionCode */ + regionCode?: (string|null); + + /** RetrieveLatestTermsOfServiceRequest kind */ + kind?: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null); + } + + /** Represents a RetrieveLatestTermsOfServiceRequest. */ + class RetrieveLatestTermsOfServiceRequest implements IRetrieveLatestTermsOfServiceRequest { + + /** + * Constructs a new RetrieveLatestTermsOfServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest); + + /** RetrieveLatestTermsOfServiceRequest regionCode. */ + public regionCode: string; + + /** RetrieveLatestTermsOfServiceRequest kind. */ + public kind: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind); + + /** + * Creates a new RetrieveLatestTermsOfServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveLatestTermsOfServiceRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest): google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest; + + /** + * Encodes the specified RetrieveLatestTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest.verify|verify} messages. + * @param message RetrieveLatestTermsOfServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveLatestTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest.verify|verify} messages. + * @param message RetrieveLatestTermsOfServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveLatestTermsOfServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveLatestTermsOfServiceRequest + * @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.RetrieveLatestTermsOfServiceRequest; + + /** + * Decodes a RetrieveLatestTermsOfServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveLatestTermsOfServiceRequest + * @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.RetrieveLatestTermsOfServiceRequest; + + /** + * Verifies a RetrieveLatestTermsOfServiceRequest 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 RetrieveLatestTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveLatestTermsOfServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest; + + /** + * Creates a plain object from a RetrieveLatestTermsOfServiceRequest message. Also converts values to other types if specified. + * @param message RetrieveLatestTermsOfServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveLatestTermsOfServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveLatestTermsOfServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcceptTermsOfServiceRequest. */ + interface IAcceptTermsOfServiceRequest { + + /** AcceptTermsOfServiceRequest name */ + name?: (string|null); + + /** AcceptTermsOfServiceRequest account */ + account?: (string|null); + + /** AcceptTermsOfServiceRequest regionCode */ + regionCode?: (string|null); + } + + /** Represents an AcceptTermsOfServiceRequest. */ + class AcceptTermsOfServiceRequest implements IAcceptTermsOfServiceRequest { + + /** + * Constructs a new AcceptTermsOfServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest); + + /** AcceptTermsOfServiceRequest name. */ + public name: string; + + /** AcceptTermsOfServiceRequest account. */ + public account: string; + + /** AcceptTermsOfServiceRequest regionCode. */ + public regionCode: string; + + /** + * Creates a new AcceptTermsOfServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceptTermsOfServiceRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest): google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest; + + /** + * Encodes the specified AcceptTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest.verify|verify} messages. + * @param message AcceptTermsOfServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceptTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest.verify|verify} messages. + * @param message AcceptTermsOfServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceptTermsOfServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceptTermsOfServiceRequest + * @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.AcceptTermsOfServiceRequest; + + /** + * Decodes an AcceptTermsOfServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceptTermsOfServiceRequest + * @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.AcceptTermsOfServiceRequest; + + /** + * Verifies an AcceptTermsOfServiceRequest 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 AcceptTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceptTermsOfServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest; + + /** + * Creates a plain object from an AcceptTermsOfServiceRequest message. Also converts values to other types if specified. + * @param message AcceptTermsOfServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceptTermsOfServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcceptTermsOfServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TermsOfServiceKind enum. */ + enum TermsOfServiceKind { + TERMS_OF_SERVICE_KIND_UNSPECIFIED = 0, + MERCHANT_CENTER = 1 + } + + /** Represents a TermsOfServiceAgreementStateService */ + class TermsOfServiceAgreementStateService extends $protobuf.rpc.Service { + + /** + * Constructs a new TermsOfServiceAgreementStateService 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 TermsOfServiceAgreementStateService 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): TermsOfServiceAgreementStateService; + + /** + * Calls GetTermsOfServiceAgreementState. + * @param request GetTermsOfServiceAgreementStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TermsOfServiceAgreementState + */ + public getTermsOfServiceAgreementState(request: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.GetTermsOfServiceAgreementStateCallback): void; + + /** + * Calls GetTermsOfServiceAgreementState. + * @param request GetTermsOfServiceAgreementStateRequest message or plain object + * @returns Promise + */ + public getTermsOfServiceAgreementState(request: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest): Promise; + + /** + * Calls RetrieveForApplicationTermsOfServiceAgreementState. + * @param request RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TermsOfServiceAgreementState + */ + public retrieveForApplicationTermsOfServiceAgreementState(request: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.RetrieveForApplicationTermsOfServiceAgreementStateCallback): void; + + /** + * Calls RetrieveForApplicationTermsOfServiceAgreementState. + * @param request RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object + * @returns Promise + */ + public retrieveForApplicationTermsOfServiceAgreementState(request: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest): Promise; + } + + namespace TermsOfServiceAgreementStateService { + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService|getTermsOfServiceAgreementState}. + * @param error Error, if any + * @param [response] TermsOfServiceAgreementState + */ + type GetTermsOfServiceAgreementStateCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState) => void; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService|retrieveForApplicationTermsOfServiceAgreementState}. + * @param error Error, if any + * @param [response] TermsOfServiceAgreementState + */ + type RetrieveForApplicationTermsOfServiceAgreementStateCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState) => void; + } + + /** Properties of a TermsOfServiceAgreementState. */ + interface ITermsOfServiceAgreementState { + + /** TermsOfServiceAgreementState name */ + name?: (string|null); + + /** TermsOfServiceAgreementState regionCode */ + regionCode?: (string|null); + + /** TermsOfServiceAgreementState termsOfServiceKind */ + termsOfServiceKind?: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null); + + /** TermsOfServiceAgreementState accepted */ + accepted?: (google.shopping.merchant.accounts.v1beta.IAccepted|null); + + /** TermsOfServiceAgreementState required */ + required?: (google.shopping.merchant.accounts.v1beta.IRequired|null); + } + + /** Represents a TermsOfServiceAgreementState. */ + class TermsOfServiceAgreementState implements ITermsOfServiceAgreementState { + + /** + * Constructs a new TermsOfServiceAgreementState. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState); + + /** TermsOfServiceAgreementState name. */ + public name: string; + + /** TermsOfServiceAgreementState regionCode. */ + public regionCode: string; + + /** TermsOfServiceAgreementState termsOfServiceKind. */ + public termsOfServiceKind: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind); + + /** TermsOfServiceAgreementState accepted. */ + public accepted?: (google.shopping.merchant.accounts.v1beta.IAccepted|null); + + /** TermsOfServiceAgreementState required. */ + public required?: (google.shopping.merchant.accounts.v1beta.IRequired|null); + + /** TermsOfServiceAgreementState _accepted. */ + public _accepted?: "accepted"; + + /** TermsOfServiceAgreementState _required. */ + public _required?: "required"; + + /** + * Creates a new TermsOfServiceAgreementState instance using the specified properties. + * @param [properties] Properties to set + * @returns TermsOfServiceAgreementState instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState): google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState; + + /** + * Encodes the specified TermsOfServiceAgreementState message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.verify|verify} messages. + * @param message TermsOfServiceAgreementState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TermsOfServiceAgreementState message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.verify|verify} messages. + * @param message TermsOfServiceAgreementState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TermsOfServiceAgreementState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TermsOfServiceAgreementState + * @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.TermsOfServiceAgreementState; + + /** + * Decodes a TermsOfServiceAgreementState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TermsOfServiceAgreementState + * @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.TermsOfServiceAgreementState; + + /** + * Verifies a TermsOfServiceAgreementState 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 TermsOfServiceAgreementState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TermsOfServiceAgreementState + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState; + + /** + * Creates a plain object from a TermsOfServiceAgreementState message. Also converts values to other types if specified. + * @param message TermsOfServiceAgreementState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TermsOfServiceAgreementState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TermsOfServiceAgreementState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Accepted. */ + interface IAccepted { + + /** Accepted termsOfService */ + termsOfService?: (string|null); + + /** Accepted acceptedBy */ + acceptedBy?: (string|null); + + /** Accepted validUntil */ + validUntil?: (google.type.IDate|null); + } + + /** Represents an Accepted. */ + class Accepted implements IAccepted { + + /** + * Constructs a new Accepted. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IAccepted); + + /** Accepted termsOfService. */ + public termsOfService: string; + + /** Accepted acceptedBy. */ + public acceptedBy: string; + + /** Accepted validUntil. */ + public validUntil?: (google.type.IDate|null); + + /** Accepted _validUntil. */ + public _validUntil?: "validUntil"; + + /** + * Creates a new Accepted instance using the specified properties. + * @param [properties] Properties to set + * @returns Accepted instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IAccepted): google.shopping.merchant.accounts.v1beta.Accepted; + + /** + * Encodes the specified Accepted message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Accepted.verify|verify} messages. + * @param message Accepted message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IAccepted, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Accepted message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Accepted.verify|verify} messages. + * @param message Accepted message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAccepted, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Accepted message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Accepted + * @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.Accepted; + + /** + * Decodes an Accepted message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Accepted + * @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.Accepted; + + /** + * Verifies an Accepted 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 Accepted message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Accepted + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Accepted; + + /** + * Creates a plain object from an Accepted message. Also converts values to other types if specified. + * @param message Accepted + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Accepted, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Accepted to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Accepted + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Required. */ + interface IRequired { + + /** Required termsOfService */ + termsOfService?: (string|null); + + /** Required tosFileUri */ + tosFileUri?: (string|null); + } + + /** Represents a Required. */ + class Required implements IRequired { + + /** + * Constructs a new Required. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IRequired); + + /** Required termsOfService. */ + public termsOfService: string; + + /** Required tosFileUri. */ + public tosFileUri: string; + + /** + * Creates a new Required instance using the specified properties. + * @param [properties] Properties to set + * @returns Required instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IRequired): google.shopping.merchant.accounts.v1beta.Required; + + /** + * Encodes the specified Required message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Required.verify|verify} messages. + * @param message Required message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IRequired, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Required message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Required.verify|verify} messages. + * @param message Required message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRequired, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Required message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Required + * @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.Required; + + /** + * Decodes a Required message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Required + * @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.Required; + + /** + * Verifies a Required 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 Required message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Required + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Required; + + /** + * Creates a plain object from a Required message. Also converts values to other types if specified. + * @param message Required + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.Required, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Required to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Required + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTermsOfServiceAgreementStateRequest. */ + interface IGetTermsOfServiceAgreementStateRequest { + + /** GetTermsOfServiceAgreementStateRequest name */ + name?: (string|null); + } + + /** Represents a GetTermsOfServiceAgreementStateRequest. */ + class GetTermsOfServiceAgreementStateRequest implements IGetTermsOfServiceAgreementStateRequest { + + /** + * Constructs a new GetTermsOfServiceAgreementStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest); + + /** GetTermsOfServiceAgreementStateRequest name. */ + public name: string; + + /** + * Creates a new GetTermsOfServiceAgreementStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTermsOfServiceAgreementStateRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest): google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest; + + /** + * Encodes the specified GetTermsOfServiceAgreementStateRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest.verify|verify} messages. + * @param message GetTermsOfServiceAgreementStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTermsOfServiceAgreementStateRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest.verify|verify} messages. + * @param message GetTermsOfServiceAgreementStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTermsOfServiceAgreementStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTermsOfServiceAgreementStateRequest + * @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.GetTermsOfServiceAgreementStateRequest; + + /** + * Decodes a GetTermsOfServiceAgreementStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTermsOfServiceAgreementStateRequest + * @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.GetTermsOfServiceAgreementStateRequest; + + /** + * Verifies a GetTermsOfServiceAgreementStateRequest 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 GetTermsOfServiceAgreementStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTermsOfServiceAgreementStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest; + + /** + * Creates a plain object from a GetTermsOfServiceAgreementStateRequest message. Also converts values to other types if specified. + * @param message GetTermsOfServiceAgreementStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTermsOfServiceAgreementStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTermsOfServiceAgreementStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrieveForApplicationTermsOfServiceAgreementStateRequest. */ + interface IRetrieveForApplicationTermsOfServiceAgreementStateRequest { + + /** RetrieveForApplicationTermsOfServiceAgreementStateRequest parent */ + parent?: (string|null); + } + + /** Represents a RetrieveForApplicationTermsOfServiceAgreementStateRequest. */ + class RetrieveForApplicationTermsOfServiceAgreementStateRequest implements IRetrieveForApplicationTermsOfServiceAgreementStateRequest { + + /** + * Constructs a new RetrieveForApplicationTermsOfServiceAgreementStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest); + + /** RetrieveForApplicationTermsOfServiceAgreementStateRequest parent. */ + public parent: string; + + /** + * Creates a new RetrieveForApplicationTermsOfServiceAgreementStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrieveForApplicationTermsOfServiceAgreementStateRequest instance + */ + public static create(properties?: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest): google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest; + + /** + * Encodes the specified RetrieveForApplicationTermsOfServiceAgreementStateRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify|verify} messages. + * @param message RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrieveForApplicationTermsOfServiceAgreementStateRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify|verify} messages. + * @param message RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @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.RetrieveForApplicationTermsOfServiceAgreementStateRequest; + + /** + * Decodes a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @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.RetrieveForApplicationTermsOfServiceAgreementStateRequest; + + /** + * Verifies a RetrieveForApplicationTermsOfServiceAgreementStateRequest 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 RetrieveForApplicationTermsOfServiceAgreementStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrieveForApplicationTermsOfServiceAgreementStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest; + + /** + * Creates a plain object from a RetrieveForApplicationTermsOfServiceAgreementStateRequest message. Also converts values to other types if specified. + * @param message RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrieveForApplicationTermsOfServiceAgreementStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Weight. */ + interface IWeight { + + /** Weight amountMicros */ + amountMicros?: (number|Long|string|null); + + /** Weight unit */ + unit?: (google.shopping.type.Weight.WeightUnit|keyof typeof google.shopping.type.Weight.WeightUnit|null); + } + + /** Represents a Weight. */ + class Weight implements IWeight { + + /** + * Constructs a new Weight. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.type.IWeight); + + /** Weight amountMicros. */ + public amountMicros?: (number|Long|string|null); + + /** Weight unit. */ + public unit: (google.shopping.type.Weight.WeightUnit|keyof typeof google.shopping.type.Weight.WeightUnit); + + /** Weight _amountMicros. */ + public _amountMicros?: "amountMicros"; + + /** + * Creates a new Weight instance using the specified properties. + * @param [properties] Properties to set + * @returns Weight instance + */ + public static create(properties?: google.shopping.type.IWeight): google.shopping.type.Weight; + + /** + * Encodes the specified Weight message. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages. + * @param message Weight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.type.IWeight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages. + * @param message Weight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.type.IWeight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Weight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Weight + * @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.type.Weight; + + /** + * Decodes a Weight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Weight + * @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.type.Weight; + + /** + * Verifies a Weight 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 Weight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Weight + */ + public static fromObject(object: { [k: string]: any }): google.shopping.type.Weight; + + /** + * Creates a plain object from a Weight message. Also converts values to other types if specified. + * @param message Weight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.type.Weight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Weight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Weight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Weight { + + /** WeightUnit enum. */ + enum WeightUnit { + WEIGHT_UNIT_UNSPECIFIED = 0, + POUND = 1, + KILOGRAM = 2 + } + } + + /** Properties of a Price. */ + interface IPrice { + + /** Price amountMicros */ + amountMicros?: (number|Long|string|null); + + /** Price currencyCode */ + currencyCode?: (string|null); + } + + /** Represents a Price. */ + class Price implements IPrice { + + /** + * Constructs a new Price. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.type.IPrice); + + /** Price amountMicros. */ + public amountMicros?: (number|Long|string|null); + + /** Price currencyCode. */ + public currencyCode?: (string|null); + + /** Price _amountMicros. */ + public _amountMicros?: "amountMicros"; + + /** Price _currencyCode. */ + public _currencyCode?: "currencyCode"; + + /** + * Creates a new Price instance using the specified properties. + * @param [properties] Properties to set + * @returns Price instance + */ + public static create(properties?: google.shopping.type.IPrice): google.shopping.type.Price; + + /** + * Encodes the specified Price message. Does not implicitly {@link google.shopping.type.Price.verify|verify} messages. + * @param message Price message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.type.IPrice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Price message, length delimited. Does not implicitly {@link google.shopping.type.Price.verify|verify} messages. + * @param message Price message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.type.IPrice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Price message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Price + * @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.type.Price; + + /** + * Decodes a Price message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Price + * @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.type.Price; + + /** + * Verifies a Price 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 Price message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Price + */ + public static fromObject(object: { [k: string]: any }): google.shopping.type.Price; + + /** + * Creates a plain object from a Price message. Also converts values to other types if specified. + * @param message Price + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.type.Price, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Price to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Price + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomAttribute. */ + interface ICustomAttribute { + + /** CustomAttribute name */ + name?: (string|null); + + /** CustomAttribute value */ + value?: (string|null); + + /** CustomAttribute groupValues */ + groupValues?: (google.shopping.type.ICustomAttribute[]|null); + } + + /** Represents a CustomAttribute. */ + class CustomAttribute implements ICustomAttribute { + + /** + * Constructs a new CustomAttribute. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.type.ICustomAttribute); + + /** CustomAttribute name. */ + public name?: (string|null); + + /** CustomAttribute value. */ + public value?: (string|null); + + /** CustomAttribute groupValues. */ + public groupValues: google.shopping.type.ICustomAttribute[]; + + /** CustomAttribute _name. */ + public _name?: "name"; + + /** CustomAttribute _value. */ + public _value?: "value"; + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomAttribute instance + */ + public static create(properties?: google.shopping.type.ICustomAttribute): google.shopping.type.CustomAttribute; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.shopping.type.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.type.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.shopping.type.CustomAttribute.verify|verify} messages. + * @param message CustomAttribute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.type.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomAttribute + * @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.type.CustomAttribute; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomAttribute + * @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.type.CustomAttribute; + + /** + * Verifies a CustomAttribute 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 CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomAttribute + */ + public static fromObject(object: { [k: string]: any }): google.shopping.type.CustomAttribute; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @param message CustomAttribute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.type.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomAttribute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomAttribute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Destination. */ + interface IDestination { + } + + /** Represents a Destination. */ + class Destination implements IDestination { + + /** + * Constructs a new Destination. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.type.IDestination); + + /** + * Creates a new Destination instance using the specified properties. + * @param [properties] Properties to set + * @returns Destination instance + */ + public static create(properties?: google.shopping.type.IDestination): google.shopping.type.Destination; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.shopping.type.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.type.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.shopping.type.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.type.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Destination + * @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.type.Destination; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Destination + * @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.type.Destination; + + /** + * Verifies a Destination 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 Destination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Destination + */ + public static fromObject(object: { [k: string]: any }): google.shopping.type.Destination; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @param message Destination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.type.Destination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Destination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Destination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Destination { + + /** DestinationEnum enum. */ + enum DestinationEnum { + DESTINATION_ENUM_UNSPECIFIED = 0, + SHOPPING_ADS = 1, + DISPLAY_ADS = 2, + LOCAL_INVENTORY_ADS = 3, + FREE_LISTINGS = 4, + FREE_LOCAL_LISTINGS = 5, + YOUTUBE_SHOPPING = 6 + } + } + + /** Properties of a ReportingContext. */ + interface IReportingContext { + } + + /** Represents a ReportingContext. */ + class ReportingContext implements IReportingContext { + + /** + * Constructs a new ReportingContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.type.IReportingContext); + + /** + * Creates a new ReportingContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ReportingContext instance + */ + public static create(properties?: google.shopping.type.IReportingContext): google.shopping.type.ReportingContext; + + /** + * Encodes the specified ReportingContext message. Does not implicitly {@link google.shopping.type.ReportingContext.verify|verify} messages. + * @param message ReportingContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.type.IReportingContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReportingContext message, length delimited. Does not implicitly {@link google.shopping.type.ReportingContext.verify|verify} messages. + * @param message ReportingContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.type.IReportingContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReportingContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReportingContext + * @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.type.ReportingContext; + + /** + * Decodes a ReportingContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReportingContext + * @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.type.ReportingContext; + + /** + * Verifies a ReportingContext 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 ReportingContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReportingContext + */ + public static fromObject(object: { [k: string]: any }): google.shopping.type.ReportingContext; + + /** + * Creates a plain object from a ReportingContext message. Also converts values to other types if specified. + * @param message ReportingContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.type.ReportingContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReportingContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReportingContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReportingContext { + + /** ReportingContextEnum enum. */ + enum ReportingContextEnum { + REPORTING_CONTEXT_ENUM_UNSPECIFIED = 0, + SHOPPING_ADS = 1, + DISCOVERY_ADS = 2, + DEMAND_GEN_ADS = 13, + DEMAND_GEN_ADS_DISCOVER_SURFACE = 14, + VIDEO_ADS = 3, + DISPLAY_ADS = 4, + LOCAL_INVENTORY_ADS = 5, + VEHICLE_INVENTORY_ADS = 6, + FREE_LISTINGS = 7, + FREE_LOCAL_LISTINGS = 8, + FREE_LOCAL_VEHICLE_LISTINGS = 9, + YOUTUBE_SHOPPING = 10, + CLOUD_RETAIL = 11, + LOCAL_CLOUD_RETAIL = 12 + } + } + + /** Properties of a Channel. */ + interface IChannel { + } + + /** Represents a Channel. */ + class Channel implements IChannel { + + /** + * Constructs a new Channel. + * @param [properties] Properties to set + */ + constructor(properties?: google.shopping.type.IChannel); + + /** + * Creates a new Channel instance using the specified properties. + * @param [properties] Properties to set + * @returns Channel instance + */ + public static create(properties?: google.shopping.type.IChannel): google.shopping.type.Channel; + + /** + * Encodes the specified Channel message. Does not implicitly {@link google.shopping.type.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.shopping.type.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link google.shopping.type.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.shopping.type.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Channel + * @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.type.Channel; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Channel + * @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.type.Channel; + + /** + * Verifies a Channel 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 Channel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Channel + */ + public static fromObject(object: { [k: string]: any }): google.shopping.type.Channel; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @param message Channel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.shopping.type.Channel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Channel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Channel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Channel { + + /** ChannelEnum enum. */ + enum ChannelEnum { + CHANNEL_ENUM_UNSPECIFIED = 0, + ONLINE = 1, + LOCAL = 2 + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http 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 Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions 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 ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions 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 MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption 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 UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart 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 NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation 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 Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration 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 Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue 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 DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue 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 FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value 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 Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value 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 UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value 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 Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value 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 UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue 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 BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue 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 StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue 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 BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Interval. */ + interface IInterval { + + /** Interval startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IInterval); + + /** Interval startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Interval instance using the specified properties. + * @param [properties] Properties to set + * @returns Interval instance + */ + public static create(properties?: google.type.IInterval): google.type.Interval; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interval + * @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.type.Interval; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interval + * @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.type.Interval; + + /** + * Verifies an Interval 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 Interval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interval + */ + public static fromObject(object: { [k: string]: any }): google.type.Interval; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @param message Interval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DateTime. */ + interface IDateTime { + + /** DateTime year */ + year?: (number|null); + + /** DateTime month */ + month?: (number|null); + + /** DateTime day */ + day?: (number|null); + + /** DateTime hours */ + hours?: (number|null); + + /** DateTime minutes */ + minutes?: (number|null); + + /** DateTime seconds */ + seconds?: (number|null); + + /** DateTime nanos */ + nanos?: (number|null); + + /** DateTime utcOffset */ + utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone */ + timeZone?: (google.type.ITimeZone|null); + } + + /** Represents a DateTime. */ + class DateTime implements IDateTime { + + /** + * Constructs a new DateTime. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDateTime); + + /** DateTime year. */ + public year: number; + + /** DateTime month. */ + public month: number; + + /** DateTime day. */ + public day: number; + + /** DateTime hours. */ + public hours: number; + + /** DateTime minutes. */ + public minutes: number; + + /** DateTime seconds. */ + public seconds: number; + + /** DateTime nanos. */ + public nanos: number; + + /** DateTime utcOffset. */ + public utcOffset?: (google.protobuf.IDuration|null); + + /** DateTime timeZone. */ + public timeZone?: (google.type.ITimeZone|null); + + /** DateTime timeOffset. */ + public timeOffset?: ("utcOffset"|"timeZone"); + + /** + * Creates a new DateTime instance using the specified properties. + * @param [properties] Properties to set + * @returns DateTime instance + */ + public static create(properties?: google.type.IDateTime): google.type.DateTime; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @param message DateTime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DateTime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DateTime + * @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.type.DateTime; + + /** + * Decodes a DateTime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DateTime + * @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.type.DateTime; + + /** + * Verifies a DateTime 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 DateTime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DateTime + */ + public static fromObject(object: { [k: string]: any }): google.type.DateTime; + + /** + * Creates a plain object from a DateTime message. Also converts values to other types if specified. + * @param message DateTime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.DateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DateTime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DateTime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeZone. */ + interface ITimeZone { + + /** TimeZone id */ + id?: (string|null); + + /** TimeZone version */ + version?: (string|null); + } + + /** Represents a TimeZone. */ + class TimeZone implements ITimeZone { + + /** + * Constructs a new TimeZone. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeZone); + + /** TimeZone id. */ + public id: string; + + /** TimeZone version. */ + public version: string; + + /** + * Creates a new TimeZone instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeZone instance + */ + public static create(properties?: google.type.ITimeZone): google.type.TimeZone; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @param message TimeZone message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeZone message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeZone + * @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.type.TimeZone; + + /** + * Decodes a TimeZone message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeZone + * @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.type.TimeZone; + + /** + * Verifies a TimeZone 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 TimeZone message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeZone + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeZone; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @param message TimeZone + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeZone to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeZone + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhoneNumber. */ + interface IPhoneNumber { + + /** PhoneNumber e164Number */ + e164Number?: (string|null); + + /** PhoneNumber shortCode */ + shortCode?: (google.type.PhoneNumber.IShortCode|null); + + /** PhoneNumber extension */ + extension?: (string|null); + } + + /** Represents a PhoneNumber. */ + class PhoneNumber implements IPhoneNumber { + + /** + * Constructs a new PhoneNumber. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IPhoneNumber); + + /** PhoneNumber e164Number. */ + public e164Number?: (string|null); + + /** PhoneNumber shortCode. */ + public shortCode?: (google.type.PhoneNumber.IShortCode|null); + + /** PhoneNumber extension. */ + public extension: string; + + /** PhoneNumber kind. */ + public kind?: ("e164Number"|"shortCode"); + + /** + * Creates a new PhoneNumber instance using the specified properties. + * @param [properties] Properties to set + * @returns PhoneNumber instance + */ + public static create(properties?: google.type.IPhoneNumber): google.type.PhoneNumber; + + /** + * Encodes the specified PhoneNumber message. Does not implicitly {@link google.type.PhoneNumber.verify|verify} messages. + * @param message PhoneNumber message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IPhoneNumber, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhoneNumber message, length delimited. Does not implicitly {@link google.type.PhoneNumber.verify|verify} messages. + * @param message PhoneNumber message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IPhoneNumber, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhoneNumber message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhoneNumber + * @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.type.PhoneNumber; + + /** + * Decodes a PhoneNumber message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhoneNumber + * @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.type.PhoneNumber; + + /** + * Verifies a PhoneNumber 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 PhoneNumber message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhoneNumber + */ + public static fromObject(object: { [k: string]: any }): google.type.PhoneNumber; + + /** + * Creates a plain object from a PhoneNumber message. Also converts values to other types if specified. + * @param message PhoneNumber + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.PhoneNumber, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhoneNumber to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhoneNumber + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PhoneNumber { + + /** Properties of a ShortCode. */ + interface IShortCode { + + /** ShortCode regionCode */ + regionCode?: (string|null); + + /** ShortCode number */ + number?: (string|null); + } + + /** Represents a ShortCode. */ + class ShortCode implements IShortCode { + + /** + * Constructs a new ShortCode. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.PhoneNumber.IShortCode); + + /** ShortCode regionCode. */ + public regionCode: string; + + /** ShortCode number. */ + public number: string; + + /** + * Creates a new ShortCode instance using the specified properties. + * @param [properties] Properties to set + * @returns ShortCode instance + */ + public static create(properties?: google.type.PhoneNumber.IShortCode): google.type.PhoneNumber.ShortCode; + + /** + * Encodes the specified ShortCode message. Does not implicitly {@link google.type.PhoneNumber.ShortCode.verify|verify} messages. + * @param message ShortCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.PhoneNumber.IShortCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShortCode message, length delimited. Does not implicitly {@link google.type.PhoneNumber.ShortCode.verify|verify} messages. + * @param message ShortCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.PhoneNumber.IShortCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShortCode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShortCode + * @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.type.PhoneNumber.ShortCode; + + /** + * Decodes a ShortCode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShortCode + * @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.type.PhoneNumber.ShortCode; + + /** + * Verifies a ShortCode 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 ShortCode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShortCode + */ + public static fromObject(object: { [k: string]: any }): google.type.PhoneNumber.ShortCode; + + /** + * Creates a plain object from a ShortCode message. Also converts values to other types if specified. + * @param message ShortCode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.PhoneNumber.ShortCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShortCode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShortCode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PostalAddress. */ + interface IPostalAddress { + + /** PostalAddress revision */ + revision?: (number|null); + + /** PostalAddress regionCode */ + regionCode?: (string|null); + + /** PostalAddress languageCode */ + languageCode?: (string|null); + + /** PostalAddress postalCode */ + postalCode?: (string|null); + + /** PostalAddress sortingCode */ + sortingCode?: (string|null); + + /** PostalAddress administrativeArea */ + administrativeArea?: (string|null); + + /** PostalAddress locality */ + locality?: (string|null); + + /** PostalAddress sublocality */ + sublocality?: (string|null); + + /** PostalAddress addressLines */ + addressLines?: (string[]|null); + + /** PostalAddress recipients */ + recipients?: (string[]|null); + + /** PostalAddress organization */ + organization?: (string|null); + } + + /** Represents a PostalAddress. */ + class PostalAddress implements IPostalAddress { + + /** + * Constructs a new PostalAddress. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IPostalAddress); + + /** PostalAddress revision. */ + public revision: number; + + /** PostalAddress regionCode. */ + public regionCode: string; + + /** PostalAddress languageCode. */ + public languageCode: string; + + /** PostalAddress postalCode. */ + public postalCode: string; + + /** PostalAddress sortingCode. */ + public sortingCode: string; + + /** PostalAddress administrativeArea. */ + public administrativeArea: string; + + /** PostalAddress locality. */ + public locality: string; + + /** PostalAddress sublocality. */ + public sublocality: string; + + /** PostalAddress addressLines. */ + public addressLines: string[]; + + /** PostalAddress recipients. */ + public recipients: string[]; + + /** PostalAddress organization. */ + public organization: string; + + /** + * Creates a new PostalAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns PostalAddress instance + */ + public static create(properties?: google.type.IPostalAddress): google.type.PostalAddress; + + /** + * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @param message PostalAddress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @param message PostalAddress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostalAddress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostalAddress + * @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.type.PostalAddress; + + /** + * Decodes a PostalAddress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostalAddress + * @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.type.PostalAddress; + + /** + * Verifies a PostalAddress 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 PostalAddress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostalAddress + */ + public static fromObject(object: { [k: string]: any }): google.type.PostalAddress; + + /** + * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. + * @param message PostalAddress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.PostalAddress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostalAddress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostalAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @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.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @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.type.Date; + + /** + * Verifies a Date 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 Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.js new file mode 100644 index 00000000000..3052ae48151 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.js @@ -0,0 +1,57252 @@ +// 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_shopping_accounts_protos || ($protobuf.roots._google_shopping_accounts_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.shopping = (function() { + + /** + * Namespace shopping. + * @memberof google + * @namespace + */ + var shopping = {}; + + shopping.merchant = (function() { + + /** + * Namespace merchant. + * @memberof google.shopping + * @namespace + */ + var merchant = {}; + + merchant.accounts = (function() { + + /** + * Namespace accounts. + * @memberof google.shopping.merchant + * @namespace + */ + var accounts = {}; + + accounts.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.shopping.merchant.accounts + * @namespace + */ + var v1beta = {}; + + /** + * AccessRight enum. + * @name google.shopping.merchant.accounts.v1beta.AccessRight + * @enum {number} + * @property {number} ACCESS_RIGHT_UNSPECIFIED=0 ACCESS_RIGHT_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} ADMIN=2 ADMIN value + * @property {number} PERFORMANCE_REPORTING=3 PERFORMANCE_REPORTING value + */ + v1beta.AccessRight = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_RIGHT_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "ADMIN"] = 2; + values[valuesById[3] = "PERFORMANCE_REPORTING"] = 3; + return values; + })(); + + v1beta.AccountTaxService = (function() { + + /** + * Constructs a new AccountTaxService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an AccountTaxService + * @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 AccountTaxService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AccountTaxService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AccountTaxService; + + /** + * Creates new AccountTaxService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @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 {AccountTaxService} RPC service. Useful where requests and/or responses are streamed. + */ + AccountTaxService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|getAccountTax}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @typedef GetAccountTaxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.AccountTax} [response] AccountTax + */ + + /** + * Calls GetAccountTax. + * @function getAccountTax + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest} request GetAccountTaxRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountTaxService.GetAccountTaxCallback} callback Node-style callback called with the error, if any, and AccountTax + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountTaxService.prototype.getAccountTax = function getAccountTax(request, callback) { + return this.rpcCall(getAccountTax, $root.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest, $root.google.shopping.merchant.accounts.v1beta.AccountTax, request, callback); + }, "name", { value: "GetAccountTax" }); + + /** + * Calls GetAccountTax. + * @function getAccountTax + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest} request GetAccountTaxRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|listAccountTax}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @typedef ListAccountTaxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} [response] ListAccountTaxResponse + */ + + /** + * Calls ListAccountTax. + * @function listAccountTax + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest} request ListAccountTaxRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountTaxService.ListAccountTaxCallback} callback Node-style callback called with the error, if any, and ListAccountTaxResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountTaxService.prototype.listAccountTax = function listAccountTax(request, callback) { + return this.rpcCall(listAccountTax, $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest, $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse, request, callback); + }, "name", { value: "ListAccountTax" }); + + /** + * Calls ListAccountTax. + * @function listAccountTax + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest} request ListAccountTaxRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|updateAccountTax}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @typedef UpdateAccountTaxCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.AccountTax} [response] AccountTax + */ + + /** + * Calls UpdateAccountTax. + * @function updateAccountTax + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest} request UpdateAccountTaxRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountTaxService.UpdateAccountTaxCallback} callback Node-style callback called with the error, if any, and AccountTax + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountTaxService.prototype.updateAccountTax = function updateAccountTax(request, callback) { + return this.rpcCall(updateAccountTax, $root.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest, $root.google.shopping.merchant.accounts.v1beta.AccountTax, request, callback); + }, "name", { value: "UpdateAccountTax" }); + + /** + * Calls UpdateAccountTax. + * @function updateAccountTax + * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest} request UpdateAccountTaxRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AccountTaxService; + })(); + + v1beta.AccountTax = (function() { + + /** + * Properties of an AccountTax. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IAccountTax + * @property {string|null} [name] AccountTax name + * @property {number|Long|null} [account] AccountTax account + * @property {Array.|null} [taxRules] AccountTax taxRules + */ + + /** + * Constructs a new AccountTax. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an AccountTax. + * @implements IAccountTax + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IAccountTax=} [properties] Properties to set + */ + function AccountTax(properties) { + this.taxRules = []; + 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]]; + } + + /** + * AccountTax name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @instance + */ + AccountTax.prototype.name = ""; + + /** + * AccountTax account. + * @member {number|Long} account + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @instance + */ + AccountTax.prototype.account = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AccountTax taxRules. + * @member {Array.} taxRules + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @instance + */ + AccountTax.prototype.taxRules = $util.emptyArray; + + /** + * Creates a new AccountTax instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccountTax=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.AccountTax} AccountTax instance + */ + AccountTax.create = function create(properties) { + return new AccountTax(properties); + }; + + /** + * Encodes the specified AccountTax message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountTax.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccountTax} message AccountTax message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountTax.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.account != null && Object.hasOwnProperty.call(message, "account")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.account); + if (message.taxRules != null && message.taxRules.length) + for (var i = 0; i < message.taxRules.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.TaxRule.encode(message.taxRules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccountTax message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountTax.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccountTax} message AccountTax message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountTax.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccountTax message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @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.AccountTax} AccountTax + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountTax.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.AccountTax(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.account = reader.int64(); + break; + } + case 3: { + if (!(message.taxRules && message.taxRules.length)) + message.taxRules = []; + message.taxRules.push($root.google.shopping.merchant.accounts.v1beta.TaxRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccountTax message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.AccountTax} AccountTax + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountTax.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccountTax message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccountTax.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.account != null && message.hasOwnProperty("account")) + if (!$util.isInteger(message.account) && !(message.account && $util.isInteger(message.account.low) && $util.isInteger(message.account.high))) + return "account: integer|Long expected"; + if (message.taxRules != null && message.hasOwnProperty("taxRules")) { + if (!Array.isArray(message.taxRules)) + return "taxRules: array expected"; + for (var i = 0; i < message.taxRules.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.TaxRule.verify(message.taxRules[i]); + if (error) + return "taxRules." + error; + } + } + return null; + }; + + /** + * Creates an AccountTax message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.AccountTax} AccountTax + */ + AccountTax.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AccountTax) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.AccountTax(); + if (object.name != null) + message.name = String(object.name); + if (object.account != null) + if ($util.Long) + (message.account = $util.Long.fromValue(object.account)).unsigned = false; + else if (typeof object.account === "string") + message.account = parseInt(object.account, 10); + else if (typeof object.account === "number") + message.account = object.account; + else if (typeof object.account === "object") + message.account = new $util.LongBits(object.account.low >>> 0, object.account.high >>> 0).toNumber(); + if (object.taxRules) { + if (!Array.isArray(object.taxRules)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountTax.taxRules: array expected"); + message.taxRules = []; + for (var i = 0; i < object.taxRules.length; ++i) { + if (typeof object.taxRules[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountTax.taxRules: object expected"); + message.taxRules[i] = $root.google.shopping.merchant.accounts.v1beta.TaxRule.fromObject(object.taxRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AccountTax message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountTax} message AccountTax + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccountTax.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.taxRules = []; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.account = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.account = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.account != null && message.hasOwnProperty("account")) + if (typeof message.account === "number") + object.account = options.longs === String ? String(message.account) : message.account; + else + object.account = options.longs === String ? $util.Long.prototype.toString.call(message.account) : options.longs === Number ? new $util.LongBits(message.account.low >>> 0, message.account.high >>> 0).toNumber() : message.account; + if (message.taxRules && message.taxRules.length) { + object.taxRules = []; + for (var j = 0; j < message.taxRules.length; ++j) + object.taxRules[j] = $root.google.shopping.merchant.accounts.v1beta.TaxRule.toObject(message.taxRules[j], options); + } + return object; + }; + + /** + * Converts this AccountTax to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @instance + * @returns {Object.} JSON object + */ + AccountTax.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccountTax + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.AccountTax + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountTax.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AccountTax"; + }; + + return AccountTax; + })(); + + v1beta.GetAccountTaxRequest = (function() { + + /** + * Properties of a GetAccountTaxRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetAccountTaxRequest + * @property {string|null} [name] GetAccountTaxRequest name + */ + + /** + * Constructs a new GetAccountTaxRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetAccountTaxRequest. + * @implements IGetAccountTaxRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest=} [properties] Properties to set + */ + function GetAccountTaxRequest(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]]; + } + + /** + * GetAccountTaxRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @instance + */ + GetAccountTaxRequest.prototype.name = ""; + + /** + * Creates a new GetAccountTaxRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest} GetAccountTaxRequest instance + */ + GetAccountTaxRequest.create = function create(properties) { + return new GetAccountTaxRequest(properties); + }; + + /** + * Encodes the specified GetAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest} message GetAccountTaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAccountTaxRequest.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 GetAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest} message GetAccountTaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAccountTaxRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAccountTaxRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @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.GetAccountTaxRequest} GetAccountTaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAccountTaxRequest.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.GetAccountTaxRequest(); + 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 GetAccountTaxRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest} GetAccountTaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAccountTaxRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAccountTaxRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAccountTaxRequest.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 GetAccountTaxRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest} GetAccountTaxRequest + */ + GetAccountTaxRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAccountTaxRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest} message GetAccountTaxRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAccountTaxRequest.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 GetAccountTaxRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @instance + * @returns {Object.} JSON object + */ + GetAccountTaxRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAccountTaxRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAccountTaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest"; + }; + + return GetAccountTaxRequest; + })(); + + v1beta.UpdateAccountTaxRequest = (function() { + + /** + * Properties of an UpdateAccountTaxRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUpdateAccountTaxRequest + * @property {google.shopping.merchant.accounts.v1beta.IAccountTax|null} [accountTax] UpdateAccountTaxRequest accountTax + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAccountTaxRequest updateMask + */ + + /** + * Constructs a new UpdateAccountTaxRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UpdateAccountTaxRequest. + * @implements IUpdateAccountTaxRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest=} [properties] Properties to set + */ + function UpdateAccountTaxRequest(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]]; + } + + /** + * UpdateAccountTaxRequest accountTax. + * @member {google.shopping.merchant.accounts.v1beta.IAccountTax|null|undefined} accountTax + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @instance + */ + UpdateAccountTaxRequest.prototype.accountTax = null; + + /** + * UpdateAccountTaxRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @instance + */ + UpdateAccountTaxRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAccountTaxRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest} UpdateAccountTaxRequest instance + */ + UpdateAccountTaxRequest.create = function create(properties) { + return new UpdateAccountTaxRequest(properties); + }; + + /** + * Encodes the specified UpdateAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest} message UpdateAccountTaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAccountTaxRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accountTax != null && Object.hasOwnProperty.call(message, "accountTax")) + $root.google.shopping.merchant.accounts.v1beta.AccountTax.encode(message.accountTax, 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 UpdateAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest} message UpdateAccountTaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAccountTaxRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAccountTaxRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @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.UpdateAccountTaxRequest} UpdateAccountTaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAccountTaxRequest.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.UpdateAccountTaxRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accountTax = $root.google.shopping.merchant.accounts.v1beta.AccountTax.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 UpdateAccountTaxRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest} UpdateAccountTaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAccountTaxRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAccountTaxRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAccountTaxRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accountTax != null && message.hasOwnProperty("accountTax")) { + var error = $root.google.shopping.merchant.accounts.v1beta.AccountTax.verify(message.accountTax); + if (error) + return "accountTax." + 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 UpdateAccountTaxRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest} UpdateAccountTaxRequest + */ + UpdateAccountTaxRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest(); + if (object.accountTax != null) { + if (typeof object.accountTax !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.accountTax: object expected"); + message.accountTax = $root.google.shopping.merchant.accounts.v1beta.AccountTax.fromObject(object.accountTax); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAccountTaxRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest} message UpdateAccountTaxRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAccountTaxRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.accountTax = null; + object.updateMask = null; + } + if (message.accountTax != null && message.hasOwnProperty("accountTax")) + object.accountTax = $root.google.shopping.merchant.accounts.v1beta.AccountTax.toObject(message.accountTax, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAccountTaxRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAccountTaxRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAccountTaxRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAccountTaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest"; + }; + + return UpdateAccountTaxRequest; + })(); + + v1beta.ListAccountTaxRequest = (function() { + + /** + * Properties of a ListAccountTaxRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListAccountTaxRequest + * @property {string|null} [parent] ListAccountTaxRequest parent + * @property {number|null} [pageSize] ListAccountTaxRequest pageSize + * @property {string|null} [pageToken] ListAccountTaxRequest pageToken + */ + + /** + * Constructs a new ListAccountTaxRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListAccountTaxRequest. + * @implements IListAccountTaxRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest=} [properties] Properties to set + */ + function ListAccountTaxRequest(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]]; + } + + /** + * ListAccountTaxRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @instance + */ + ListAccountTaxRequest.prototype.parent = ""; + + /** + * ListAccountTaxRequest pageSize. + * @member {number} pageSize + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @instance + */ + ListAccountTaxRequest.prototype.pageSize = 0; + + /** + * ListAccountTaxRequest pageToken. + * @member {string} pageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @instance + */ + ListAccountTaxRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAccountTaxRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest} ListAccountTaxRequest instance + */ + ListAccountTaxRequest.create = function create(properties) { + return new ListAccountTaxRequest(properties); + }; + + /** + * Encodes the specified ListAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest} message ListAccountTaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountTaxRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest} message ListAccountTaxRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountTaxRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAccountTaxRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @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.ListAccountTaxRequest} ListAccountTaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountTaxRequest.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.ListAccountTaxRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAccountTaxRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest} ListAccountTaxRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountTaxRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAccountTaxRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAccountTaxRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAccountTaxRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest} ListAccountTaxRequest + */ + ListAccountTaxRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAccountTaxRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest} message ListAccountTaxRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAccountTaxRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAccountTaxRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @instance + * @returns {Object.} JSON object + */ + ListAccountTaxRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAccountTaxRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAccountTaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest"; + }; + + return ListAccountTaxRequest; + })(); + + v1beta.ListAccountTaxResponse = (function() { + + /** + * Properties of a ListAccountTaxResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListAccountTaxResponse + * @property {Array.|null} [accountTaxes] ListAccountTaxResponse accountTaxes + * @property {string|null} [nextPageToken] ListAccountTaxResponse nextPageToken + */ + + /** + * Constructs a new ListAccountTaxResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListAccountTaxResponse. + * @implements IListAccountTaxResponse + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse=} [properties] Properties to set + */ + function ListAccountTaxResponse(properties) { + this.accountTaxes = []; + 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]]; + } + + /** + * ListAccountTaxResponse accountTaxes. + * @member {Array.} accountTaxes + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @instance + */ + ListAccountTaxResponse.prototype.accountTaxes = $util.emptyArray; + + /** + * ListAccountTaxResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @instance + */ + ListAccountTaxResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAccountTaxResponse instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} ListAccountTaxResponse instance + */ + ListAccountTaxResponse.create = function create(properties) { + return new ListAccountTaxResponse(properties); + }; + + /** + * Encodes the specified ListAccountTaxResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse} message ListAccountTaxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountTaxResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accountTaxes != null && message.accountTaxes.length) + for (var i = 0; i < message.accountTaxes.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.AccountTax.encode(message.accountTaxes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAccountTaxResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse} message ListAccountTaxResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountTaxResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAccountTaxResponse message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @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.ListAccountTaxResponse} ListAccountTaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountTaxResponse.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.ListAccountTaxResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.accountTaxes && message.accountTaxes.length)) + message.accountTaxes = []; + message.accountTaxes.push($root.google.shopping.merchant.accounts.v1beta.AccountTax.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAccountTaxResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} ListAccountTaxResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountTaxResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAccountTaxResponse message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAccountTaxResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accountTaxes != null && message.hasOwnProperty("accountTaxes")) { + if (!Array.isArray(message.accountTaxes)) + return "accountTaxes: array expected"; + for (var i = 0; i < message.accountTaxes.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.AccountTax.verify(message.accountTaxes[i]); + if (error) + return "accountTaxes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAccountTaxResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} ListAccountTaxResponse + */ + ListAccountTaxResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse(); + if (object.accountTaxes) { + if (!Array.isArray(object.accountTaxes)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.accountTaxes: array expected"); + message.accountTaxes = []; + for (var i = 0; i < object.accountTaxes.length; ++i) { + if (typeof object.accountTaxes[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.accountTaxes: object expected"); + message.accountTaxes[i] = $root.google.shopping.merchant.accounts.v1beta.AccountTax.fromObject(object.accountTaxes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAccountTaxResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} message ListAccountTaxResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAccountTaxResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accountTaxes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.accountTaxes && message.accountTaxes.length) { + object.accountTaxes = []; + for (var j = 0; j < message.accountTaxes.length; ++j) + object.accountTaxes[j] = $root.google.shopping.merchant.accounts.v1beta.AccountTax.toObject(message.accountTaxes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAccountTaxResponse to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @instance + * @returns {Object.} JSON object + */ + ListAccountTaxResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAccountTaxResponse + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAccountTaxResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse"; + }; + + return ListAccountTaxResponse; + })(); + + v1beta.TaxRule = (function() { + + /** + * Properties of a TaxRule. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ITaxRule + * @property {number|Long|null} [locationId] TaxRule locationId + * @property {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange|null} [postCodeRange] TaxRule postCodeRange + * @property {boolean|null} [useGoogleRate] TaxRule useGoogleRate + * @property {number|Long|null} [selfSpecifiedRateMicros] TaxRule selfSpecifiedRateMicros + * @property {string|null} [regionCode] TaxRule regionCode + * @property {boolean|null} [shippingTaxed] TaxRule shippingTaxed + * @property {google.type.IInterval|null} [effectiveTimePeriod] TaxRule effectiveTimePeriod + */ + + /** + * Constructs a new TaxRule. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a TaxRule. + * @implements ITaxRule + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ITaxRule=} [properties] Properties to set + */ + function TaxRule(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]]; + } + + /** + * TaxRule locationId. + * @member {number|Long|null|undefined} locationId + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + */ + TaxRule.prototype.locationId = null; + + /** + * TaxRule postCodeRange. + * @member {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange|null|undefined} postCodeRange + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + */ + TaxRule.prototype.postCodeRange = null; + + /** + * TaxRule useGoogleRate. + * @member {boolean|null|undefined} useGoogleRate + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + */ + TaxRule.prototype.useGoogleRate = null; + + /** + * TaxRule selfSpecifiedRateMicros. + * @member {number|Long|null|undefined} selfSpecifiedRateMicros + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + */ + TaxRule.prototype.selfSpecifiedRateMicros = null; + + /** + * TaxRule regionCode. + * @member {string} regionCode + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + */ + TaxRule.prototype.regionCode = ""; + + /** + * TaxRule shippingTaxed. + * @member {boolean} shippingTaxed + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + */ + TaxRule.prototype.shippingTaxed = false; + + /** + * TaxRule effectiveTimePeriod. + * @member {google.type.IInterval|null|undefined} effectiveTimePeriod + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + */ + TaxRule.prototype.effectiveTimePeriod = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TaxRule location. + * @member {"locationId"|"postCodeRange"|undefined} location + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + */ + Object.defineProperty(TaxRule.prototype, "location", { + get: $util.oneOfGetter($oneOfFields = ["locationId", "postCodeRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TaxRule rateCalculation. + * @member {"useGoogleRate"|"selfSpecifiedRateMicros"|undefined} rateCalculation + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + */ + Object.defineProperty(TaxRule.prototype, "rateCalculation", { + get: $util.oneOfGetter($oneOfFields = ["useGoogleRate", "selfSpecifiedRateMicros"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TaxRule instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITaxRule=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.TaxRule} TaxRule instance + */ + TaxRule.create = function create(properties) { + return new TaxRule(properties); + }; + + /** + * Encodes the specified TaxRule message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITaxRule} message TaxRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaxRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.locationId); + if (message.postCodeRange != null && Object.hasOwnProperty.call(message, "postCodeRange")) + $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.encode(message.postCodeRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.useGoogleRate != null && Object.hasOwnProperty.call(message, "useGoogleRate")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.useGoogleRate); + if (message.selfSpecifiedRateMicros != null && Object.hasOwnProperty.call(message, "selfSpecifiedRateMicros")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.selfSpecifiedRateMicros); + if (message.shippingTaxed != null && Object.hasOwnProperty.call(message, "shippingTaxed")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.shippingTaxed); + if (message.effectiveTimePeriod != null && Object.hasOwnProperty.call(message, "effectiveTimePeriod")) + $root.google.type.Interval.encode(message.effectiveTimePeriod, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TaxRule message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITaxRule} message TaxRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaxRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaxRule message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @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.TaxRule} TaxRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaxRule.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.TaxRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.locationId = reader.int64(); + break; + } + case 3: { + message.postCodeRange = $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.decode(reader, reader.uint32()); + break; + } + case 4: { + message.useGoogleRate = reader.bool(); + break; + } + case 5: { + message.selfSpecifiedRateMicros = reader.int64(); + break; + } + case 1: { + message.regionCode = reader.string(); + break; + } + case 6: { + message.shippingTaxed = reader.bool(); + break; + } + case 7: { + message.effectiveTimePeriod = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaxRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.TaxRule} TaxRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaxRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaxRule message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaxRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.locationId != null && message.hasOwnProperty("locationId")) { + properties.location = 1; + if (!$util.isInteger(message.locationId) && !(message.locationId && $util.isInteger(message.locationId.low) && $util.isInteger(message.locationId.high))) + return "locationId: integer|Long expected"; + } + if (message.postCodeRange != null && message.hasOwnProperty("postCodeRange")) { + if (properties.location === 1) + return "location: multiple values"; + properties.location = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify(message.postCodeRange); + if (error) + return "postCodeRange." + error; + } + } + if (message.useGoogleRate != null && message.hasOwnProperty("useGoogleRate")) { + properties.rateCalculation = 1; + if (typeof message.useGoogleRate !== "boolean") + return "useGoogleRate: boolean expected"; + } + if (message.selfSpecifiedRateMicros != null && message.hasOwnProperty("selfSpecifiedRateMicros")) { + if (properties.rateCalculation === 1) + return "rateCalculation: multiple values"; + properties.rateCalculation = 1; + if (!$util.isInteger(message.selfSpecifiedRateMicros) && !(message.selfSpecifiedRateMicros && $util.isInteger(message.selfSpecifiedRateMicros.low) && $util.isInteger(message.selfSpecifiedRateMicros.high))) + return "selfSpecifiedRateMicros: integer|Long expected"; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.shippingTaxed != null && message.hasOwnProperty("shippingTaxed")) + if (typeof message.shippingTaxed !== "boolean") + return "shippingTaxed: boolean expected"; + if (message.effectiveTimePeriod != null && message.hasOwnProperty("effectiveTimePeriod")) { + var error = $root.google.type.Interval.verify(message.effectiveTimePeriod); + if (error) + return "effectiveTimePeriod." + error; + } + return null; + }; + + /** + * Creates a TaxRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.TaxRule} TaxRule + */ + TaxRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TaxRule) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.TaxRule(); + if (object.locationId != null) + if ($util.Long) + (message.locationId = $util.Long.fromValue(object.locationId)).unsigned = false; + else if (typeof object.locationId === "string") + message.locationId = parseInt(object.locationId, 10); + else if (typeof object.locationId === "number") + message.locationId = object.locationId; + else if (typeof object.locationId === "object") + message.locationId = new $util.LongBits(object.locationId.low >>> 0, object.locationId.high >>> 0).toNumber(); + if (object.postCodeRange != null) { + if (typeof object.postCodeRange !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.TaxRule.postCodeRange: object expected"); + message.postCodeRange = $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.fromObject(object.postCodeRange); + } + if (object.useGoogleRate != null) + message.useGoogleRate = Boolean(object.useGoogleRate); + if (object.selfSpecifiedRateMicros != null) + if ($util.Long) + (message.selfSpecifiedRateMicros = $util.Long.fromValue(object.selfSpecifiedRateMicros)).unsigned = false; + else if (typeof object.selfSpecifiedRateMicros === "string") + message.selfSpecifiedRateMicros = parseInt(object.selfSpecifiedRateMicros, 10); + else if (typeof object.selfSpecifiedRateMicros === "number") + message.selfSpecifiedRateMicros = object.selfSpecifiedRateMicros; + else if (typeof object.selfSpecifiedRateMicros === "object") + message.selfSpecifiedRateMicros = new $util.LongBits(object.selfSpecifiedRateMicros.low >>> 0, object.selfSpecifiedRateMicros.high >>> 0).toNumber(); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.shippingTaxed != null) + message.shippingTaxed = Boolean(object.shippingTaxed); + if (object.effectiveTimePeriod != null) { + if (typeof object.effectiveTimePeriod !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.TaxRule.effectiveTimePeriod: object expected"); + message.effectiveTimePeriod = $root.google.type.Interval.fromObject(object.effectiveTimePeriod); + } + return message; + }; + + /** + * Creates a plain object from a TaxRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @static + * @param {google.shopping.merchant.accounts.v1beta.TaxRule} message TaxRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaxRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionCode = ""; + object.shippingTaxed = false; + object.effectiveTimePeriod = null; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.locationId != null && message.hasOwnProperty("locationId")) { + if (typeof message.locationId === "number") + object.locationId = options.longs === String ? String(message.locationId) : message.locationId; + else + object.locationId = options.longs === String ? $util.Long.prototype.toString.call(message.locationId) : options.longs === Number ? new $util.LongBits(message.locationId.low >>> 0, message.locationId.high >>> 0).toNumber() : message.locationId; + if (options.oneofs) + object.location = "locationId"; + } + if (message.postCodeRange != null && message.hasOwnProperty("postCodeRange")) { + object.postCodeRange = $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.toObject(message.postCodeRange, options); + if (options.oneofs) + object.location = "postCodeRange"; + } + if (message.useGoogleRate != null && message.hasOwnProperty("useGoogleRate")) { + object.useGoogleRate = message.useGoogleRate; + if (options.oneofs) + object.rateCalculation = "useGoogleRate"; + } + if (message.selfSpecifiedRateMicros != null && message.hasOwnProperty("selfSpecifiedRateMicros")) { + if (typeof message.selfSpecifiedRateMicros === "number") + object.selfSpecifiedRateMicros = options.longs === String ? String(message.selfSpecifiedRateMicros) : message.selfSpecifiedRateMicros; + else + object.selfSpecifiedRateMicros = options.longs === String ? $util.Long.prototype.toString.call(message.selfSpecifiedRateMicros) : options.longs === Number ? new $util.LongBits(message.selfSpecifiedRateMicros.low >>> 0, message.selfSpecifiedRateMicros.high >>> 0).toNumber() : message.selfSpecifiedRateMicros; + if (options.oneofs) + object.rateCalculation = "selfSpecifiedRateMicros"; + } + if (message.shippingTaxed != null && message.hasOwnProperty("shippingTaxed")) + object.shippingTaxed = message.shippingTaxed; + if (message.effectiveTimePeriod != null && message.hasOwnProperty("effectiveTimePeriod")) + object.effectiveTimePeriod = $root.google.type.Interval.toObject(message.effectiveTimePeriod, options); + return object; + }; + + /** + * Converts this TaxRule to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @instance + * @returns {Object.} JSON object + */ + TaxRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaxRule + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaxRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TaxRule"; + }; + + TaxRule.TaxPostalCodeRange = (function() { + + /** + * Properties of a TaxPostalCodeRange. + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @interface ITaxPostalCodeRange + * @property {string|null} [start] TaxPostalCodeRange start + * @property {string|null} [end] TaxPostalCodeRange end + */ + + /** + * Constructs a new TaxPostalCodeRange. + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule + * @classdesc Represents a TaxPostalCodeRange. + * @implements ITaxPostalCodeRange + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange=} [properties] Properties to set + */ + function TaxPostalCodeRange(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]]; + } + + /** + * TaxPostalCodeRange start. + * @member {string} start + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @instance + */ + TaxPostalCodeRange.prototype.start = ""; + + /** + * TaxPostalCodeRange end. + * @member {string} end + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @instance + */ + TaxPostalCodeRange.prototype.end = ""; + + /** + * Creates a new TaxPostalCodeRange instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @static + * @param {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange} TaxPostalCodeRange instance + */ + TaxPostalCodeRange.create = function create(properties) { + return new TaxPostalCodeRange(properties); + }; + + /** + * Encodes the specified TaxPostalCodeRange message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @static + * @param {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange} message TaxPostalCodeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaxPostalCodeRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.end); + return writer; + }; + + /** + * Encodes the specified TaxPostalCodeRange message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @static + * @param {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange} message TaxPostalCodeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TaxPostalCodeRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TaxPostalCodeRange message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @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.TaxRule.TaxPostalCodeRange} TaxPostalCodeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaxPostalCodeRange.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.TaxRule.TaxPostalCodeRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.string(); + break; + } + case 2: { + message.end = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TaxPostalCodeRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange} TaxPostalCodeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TaxPostalCodeRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TaxPostalCodeRange message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TaxPostalCodeRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isString(message.start)) + return "start: string expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isString(message.end)) + return "end: string expected"; + return null; + }; + + /** + * Creates a TaxPostalCodeRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange} TaxPostalCodeRange + */ + TaxPostalCodeRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange(); + if (object.start != null) + message.start = String(object.start); + if (object.end != null) + message.end = String(object.end); + return message; + }; + + /** + * Creates a plain object from a TaxPostalCodeRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @static + * @param {google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange} message TaxPostalCodeRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TaxPostalCodeRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = ""; + object.end = ""; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this TaxPostalCodeRange to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @instance + * @returns {Object.} JSON object + */ + TaxPostalCodeRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TaxPostalCodeRange + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TaxPostalCodeRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange"; + }; + + return TaxPostalCodeRange; + })(); + + return TaxRule; + })(); + + v1beta.AccountIssueService = (function() { + + /** + * Constructs a new AccountIssueService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an AccountIssueService + * @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 AccountIssueService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AccountIssueService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AccountIssueService; + + /** + * Creates new AccountIssueService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssueService + * @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 {AccountIssueService} RPC service. Useful where requests and/or responses are streamed. + */ + AccountIssueService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountIssueService|listAccountIssues}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssueService + * @typedef ListAccountIssuesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} [response] ListAccountIssuesResponse + */ + + /** + * Calls ListAccountIssues. + * @function listAccountIssues + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssueService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest} request ListAccountIssuesRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountIssueService.ListAccountIssuesCallback} callback Node-style callback called with the error, if any, and ListAccountIssuesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountIssueService.prototype.listAccountIssues = function listAccountIssues(request, callback) { + return this.rpcCall(listAccountIssues, $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest, $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse, request, callback); + }, "name", { value: "ListAccountIssues" }); + + /** + * Calls ListAccountIssues. + * @function listAccountIssues + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssueService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest} request ListAccountIssuesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AccountIssueService; + })(); + + v1beta.AccountIssue = (function() { + + /** + * Properties of an AccountIssue. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IAccountIssue + * @property {string|null} [name] AccountIssue name + * @property {string|null} [title] AccountIssue title + * @property {google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|null} [severity] AccountIssue severity + * @property {Array.|null} [impactedDestinations] AccountIssue impactedDestinations + * @property {string|null} [detail] AccountIssue detail + * @property {string|null} [documentationUri] AccountIssue documentationUri + */ + + /** + * Constructs a new AccountIssue. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an AccountIssue. + * @implements IAccountIssue + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IAccountIssue=} [properties] Properties to set + */ + function AccountIssue(properties) { + this.impactedDestinations = []; + 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]]; + } + + /** + * AccountIssue name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @instance + */ + AccountIssue.prototype.name = ""; + + /** + * AccountIssue title. + * @member {string} title + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @instance + */ + AccountIssue.prototype.title = ""; + + /** + * AccountIssue severity. + * @member {google.shopping.merchant.accounts.v1beta.AccountIssue.Severity} severity + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @instance + */ + AccountIssue.prototype.severity = 0; + + /** + * AccountIssue impactedDestinations. + * @member {Array.} impactedDestinations + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @instance + */ + AccountIssue.prototype.impactedDestinations = $util.emptyArray; + + /** + * AccountIssue detail. + * @member {string} detail + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @instance + */ + AccountIssue.prototype.detail = ""; + + /** + * AccountIssue documentationUri. + * @member {string} documentationUri + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @instance + */ + AccountIssue.prototype.documentationUri = ""; + + /** + * Creates a new AccountIssue instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccountIssue=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue} AccountIssue instance + */ + AccountIssue.create = function create(properties) { + return new AccountIssue(properties); + }; + + /** + * Encodes the specified AccountIssue message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccountIssue} message AccountIssue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountIssue.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.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.severity); + if (message.impactedDestinations != null && message.impactedDestinations.length) + for (var i = 0; i < message.impactedDestinations.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.encode(message.impactedDestinations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.detail); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentationUri); + return writer; + }; + + /** + * Encodes the specified AccountIssue message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccountIssue} message AccountIssue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountIssue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccountIssue message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @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.AccountIssue} AccountIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountIssue.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.AccountIssue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.severity = reader.int32(); + break; + } + case 4: { + if (!(message.impactedDestinations && message.impactedDestinations.length)) + message.impactedDestinations = []; + message.impactedDestinations.push($root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.decode(reader, reader.uint32())); + break; + } + case 5: { + message.detail = reader.string(); + break; + } + case 6: { + message.documentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccountIssue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue} AccountIssue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountIssue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccountIssue message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccountIssue.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.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.impactedDestinations != null && message.hasOwnProperty("impactedDestinations")) { + if (!Array.isArray(message.impactedDestinations)) + return "impactedDestinations: array expected"; + for (var i = 0; i < message.impactedDestinations.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify(message.impactedDestinations[i]); + if (error) + return "impactedDestinations." + error; + } + } + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + return null; + }; + + /** + * Creates an AccountIssue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue} AccountIssue + */ + AccountIssue.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AccountIssue) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.AccountIssue(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "CRITICAL": + case 1: + message.severity = 1; + break; + case "ERROR": + case 2: + message.severity = 2; + break; + case "SUGGESTION": + case 3: + message.severity = 3; + break; + } + if (object.impactedDestinations) { + if (!Array.isArray(object.impactedDestinations)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountIssue.impactedDestinations: array expected"); + message.impactedDestinations = []; + for (var i = 0; i < object.impactedDestinations.length; ++i) { + if (typeof object.impactedDestinations[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountIssue.impactedDestinations: object expected"); + message.impactedDestinations[i] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.fromObject(object.impactedDestinations[i]); + } + } + if (object.detail != null) + message.detail = String(object.detail); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + return message; + }; + + /** + * Creates a plain object from an AccountIssue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue} message AccountIssue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccountIssue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.impactedDestinations = []; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.detail = ""; + object.documentationUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.AccountIssue.Severity[message.severity] === undefined ? message.severity : $root.google.shopping.merchant.accounts.v1beta.AccountIssue.Severity[message.severity] : message.severity; + if (message.impactedDestinations && message.impactedDestinations.length) { + object.impactedDestinations = []; + for (var j = 0; j < message.impactedDestinations.length; ++j) + object.impactedDestinations[j] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.toObject(message.impactedDestinations[j], options); + } + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + return object; + }; + + /** + * Converts this AccountIssue to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @instance + * @returns {Object.} JSON object + */ + AccountIssue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccountIssue + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountIssue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AccountIssue"; + }; + + AccountIssue.ImpactedDestination = (function() { + + /** + * Properties of an ImpactedDestination. + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @interface IImpactedDestination + * @property {google.shopping.type.ReportingContext.ReportingContextEnum|null} [reportingContext] ImpactedDestination reportingContext + * @property {Array.|null} [impacts] ImpactedDestination impacts + */ + + /** + * Constructs a new ImpactedDestination. + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue + * @classdesc Represents an ImpactedDestination. + * @implements IImpactedDestination + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination=} [properties] Properties to set + */ + function ImpactedDestination(properties) { + this.impacts = []; + 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]]; + } + + /** + * ImpactedDestination reportingContext. + * @member {google.shopping.type.ReportingContext.ReportingContextEnum|null|undefined} reportingContext + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @instance + */ + ImpactedDestination.prototype.reportingContext = null; + + /** + * ImpactedDestination impacts. + * @member {Array.} impacts + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @instance + */ + ImpactedDestination.prototype.impacts = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImpactedDestination _reportingContext. + * @member {"reportingContext"|undefined} _reportingContext + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @instance + */ + Object.defineProperty(ImpactedDestination.prototype, "_reportingContext", { + get: $util.oneOfGetter($oneOfFields = ["reportingContext"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImpactedDestination instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination} ImpactedDestination instance + */ + ImpactedDestination.create = function create(properties) { + return new ImpactedDestination(properties); + }; + + /** + * Encodes the specified ImpactedDestination message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination} message ImpactedDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImpactedDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reportingContext != null && Object.hasOwnProperty.call(message, "reportingContext")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reportingContext); + if (message.impacts != null && message.impacts.length) + for (var i = 0; i < message.impacts.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.encode(message.impacts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImpactedDestination message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination} message ImpactedDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImpactedDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImpactedDestination message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @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.AccountIssue.ImpactedDestination} ImpactedDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImpactedDestination.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.AccountIssue.ImpactedDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reportingContext = reader.int32(); + break; + } + case 2: { + if (!(message.impacts && message.impacts.length)) + message.impacts = []; + message.impacts.push($root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImpactedDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination} ImpactedDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImpactedDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImpactedDestination message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImpactedDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.reportingContext != null && message.hasOwnProperty("reportingContext")) { + properties._reportingContext = 1; + switch (message.reportingContext) { + default: + return "reportingContext: enum value expected"; + case 0: + case 1: + case 2: + case 13: + case 14: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + } + if (message.impacts != null && message.hasOwnProperty("impacts")) { + if (!Array.isArray(message.impacts)) + return "impacts: array expected"; + for (var i = 0; i < message.impacts.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify(message.impacts[i]); + if (error) + return "impacts." + error; + } + } + return null; + }; + + /** + * Creates an ImpactedDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination} ImpactedDestination + */ + ImpactedDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination(); + switch (object.reportingContext) { + default: + if (typeof object.reportingContext === "number") { + message.reportingContext = object.reportingContext; + break; + } + break; + case "REPORTING_CONTEXT_ENUM_UNSPECIFIED": + case 0: + message.reportingContext = 0; + break; + case "SHOPPING_ADS": + case 1: + message.reportingContext = 1; + break; + case "DISCOVERY_ADS": + case 2: + message.reportingContext = 2; + break; + case "DEMAND_GEN_ADS": + case 13: + message.reportingContext = 13; + break; + case "DEMAND_GEN_ADS_DISCOVER_SURFACE": + case 14: + message.reportingContext = 14; + break; + case "VIDEO_ADS": + case 3: + message.reportingContext = 3; + break; + case "DISPLAY_ADS": + case 4: + message.reportingContext = 4; + break; + case "LOCAL_INVENTORY_ADS": + case 5: + message.reportingContext = 5; + break; + case "VEHICLE_INVENTORY_ADS": + case 6: + message.reportingContext = 6; + break; + case "FREE_LISTINGS": + case 7: + message.reportingContext = 7; + break; + case "FREE_LOCAL_LISTINGS": + case 8: + message.reportingContext = 8; + break; + case "FREE_LOCAL_VEHICLE_LISTINGS": + case 9: + message.reportingContext = 9; + break; + case "YOUTUBE_SHOPPING": + case 10: + message.reportingContext = 10; + break; + case "CLOUD_RETAIL": + case 11: + message.reportingContext = 11; + break; + case "LOCAL_CLOUD_RETAIL": + case 12: + message.reportingContext = 12; + break; + } + if (object.impacts) { + if (!Array.isArray(object.impacts)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.impacts: array expected"); + message.impacts = []; + for (var i = 0; i < object.impacts.length; ++i) { + if (typeof object.impacts[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.impacts: object expected"); + message.impacts[i] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.fromObject(object.impacts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImpactedDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination} message ImpactedDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImpactedDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.impacts = []; + if (message.reportingContext != null && message.hasOwnProperty("reportingContext")) { + object.reportingContext = options.enums === String ? $root.google.shopping.type.ReportingContext.ReportingContextEnum[message.reportingContext] === undefined ? message.reportingContext : $root.google.shopping.type.ReportingContext.ReportingContextEnum[message.reportingContext] : message.reportingContext; + if (options.oneofs) + object._reportingContext = "reportingContext"; + } + if (message.impacts && message.impacts.length) { + object.impacts = []; + for (var j = 0; j < message.impacts.length; ++j) + object.impacts[j] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.toObject(message.impacts[j], options); + } + return object; + }; + + /** + * Converts this ImpactedDestination to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @instance + * @returns {Object.} JSON object + */ + ImpactedDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImpactedDestination + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImpactedDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination"; + }; + + ImpactedDestination.Impact = (function() { + + /** + * Properties of an Impact. + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @interface IImpact + * @property {string|null} [regionCode] Impact regionCode + * @property {google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|null} [severity] Impact severity + */ + + /** + * Constructs a new Impact. + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination + * @classdesc Represents an Impact. + * @implements IImpact + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact=} [properties] Properties to set + */ + function Impact(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]]; + } + + /** + * Impact regionCode. + * @member {string} regionCode + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @instance + */ + Impact.prototype.regionCode = ""; + + /** + * Impact severity. + * @member {google.shopping.merchant.accounts.v1beta.AccountIssue.Severity} severity + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @instance + */ + Impact.prototype.severity = 0; + + /** + * Creates a new Impact instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact} Impact instance + */ + Impact.create = function create(properties) { + return new Impact(properties); + }; + + /** + * Encodes the specified Impact message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact} message Impact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Impact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.severity); + return writer; + }; + + /** + * Encodes the specified Impact message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact} message Impact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Impact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Impact message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @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.AccountIssue.ImpactedDestination.Impact} Impact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Impact.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.AccountIssue.ImpactedDestination.Impact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.regionCode = reader.string(); + break; + } + case 2: { + message.severity = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Impact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact} Impact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Impact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Impact message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Impact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an Impact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact} Impact + */ + Impact.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact(); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "CRITICAL": + case 1: + message.severity = 1; + break; + case "ERROR": + case 2: + message.severity = 2; + break; + case "SUGGESTION": + case 3: + message.severity = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an Impact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @static + * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact} message Impact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Impact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionCode = ""; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.AccountIssue.Severity[message.severity] === undefined ? message.severity : $root.google.shopping.merchant.accounts.v1beta.AccountIssue.Severity[message.severity] : message.severity; + return object; + }; + + /** + * Converts this Impact to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @instance + * @returns {Object.} JSON object + */ + Impact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Impact + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Impact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact"; + }; + + return Impact; + })(); + + return ImpactedDestination; + })(); + + /** + * Severity enum. + * @name google.shopping.merchant.accounts.v1beta.AccountIssue.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} CRITICAL=1 CRITICAL value + * @property {number} ERROR=2 ERROR value + * @property {number} SUGGESTION=3 SUGGESTION value + */ + AccountIssue.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "CRITICAL"] = 1; + values[valuesById[2] = "ERROR"] = 2; + values[valuesById[3] = "SUGGESTION"] = 3; + return values; + })(); + + return AccountIssue; + })(); + + v1beta.ListAccountIssuesRequest = (function() { + + /** + * Properties of a ListAccountIssuesRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListAccountIssuesRequest + * @property {string|null} [parent] ListAccountIssuesRequest parent + * @property {number|null} [pageSize] ListAccountIssuesRequest pageSize + * @property {string|null} [pageToken] ListAccountIssuesRequest pageToken + * @property {string|null} [languageCode] ListAccountIssuesRequest languageCode + * @property {string|null} [timeZone] ListAccountIssuesRequest timeZone + */ + + /** + * Constructs a new ListAccountIssuesRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListAccountIssuesRequest. + * @implements IListAccountIssuesRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest=} [properties] Properties to set + */ + function ListAccountIssuesRequest(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]]; + } + + /** + * ListAccountIssuesRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @instance + */ + ListAccountIssuesRequest.prototype.parent = ""; + + /** + * ListAccountIssuesRequest pageSize. + * @member {number} pageSize + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @instance + */ + ListAccountIssuesRequest.prototype.pageSize = 0; + + /** + * ListAccountIssuesRequest pageToken. + * @member {string} pageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @instance + */ + ListAccountIssuesRequest.prototype.pageToken = ""; + + /** + * ListAccountIssuesRequest languageCode. + * @member {string} languageCode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @instance + */ + ListAccountIssuesRequest.prototype.languageCode = ""; + + /** + * ListAccountIssuesRequest timeZone. + * @member {string} timeZone + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @instance + */ + ListAccountIssuesRequest.prototype.timeZone = ""; + + /** + * Creates a new ListAccountIssuesRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest} ListAccountIssuesRequest instance + */ + ListAccountIssuesRequest.create = function create(properties) { + return new ListAccountIssuesRequest(properties); + }; + + /** + * Encodes the specified ListAccountIssuesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest} message ListAccountIssuesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountIssuesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.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")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); + return writer; + }; + + /** + * Encodes the specified ListAccountIssuesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest} message ListAccountIssuesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountIssuesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAccountIssuesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @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.ListAccountIssuesRequest} ListAccountIssuesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountIssuesRequest.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.ListAccountIssuesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.languageCode = reader.string(); + break; + } + case 5: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAccountIssuesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest} ListAccountIssuesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountIssuesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAccountIssuesRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAccountIssuesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; + + /** + * Creates a ListAccountIssuesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest} ListAccountIssuesRequest + */ + ListAccountIssuesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a ListAccountIssuesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest} message ListAccountIssuesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAccountIssuesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.languageCode = ""; + object.timeZone = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + return object; + }; + + /** + * Converts this ListAccountIssuesRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAccountIssuesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAccountIssuesRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAccountIssuesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest"; + }; + + return ListAccountIssuesRequest; + })(); + + v1beta.ListAccountIssuesResponse = (function() { + + /** + * Properties of a ListAccountIssuesResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListAccountIssuesResponse + * @property {Array.|null} [accountIssues] ListAccountIssuesResponse accountIssues + * @property {string|null} [nextPageToken] ListAccountIssuesResponse nextPageToken + */ + + /** + * Constructs a new ListAccountIssuesResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListAccountIssuesResponse. + * @implements IListAccountIssuesResponse + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse=} [properties] Properties to set + */ + function ListAccountIssuesResponse(properties) { + this.accountIssues = []; + 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]]; + } + + /** + * ListAccountIssuesResponse accountIssues. + * @member {Array.} accountIssues + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @instance + */ + ListAccountIssuesResponse.prototype.accountIssues = $util.emptyArray; + + /** + * ListAccountIssuesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @instance + */ + ListAccountIssuesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAccountIssuesResponse instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} ListAccountIssuesResponse instance + */ + ListAccountIssuesResponse.create = function create(properties) { + return new ListAccountIssuesResponse(properties); + }; + + /** + * Encodes the specified ListAccountIssuesResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse} message ListAccountIssuesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountIssuesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accountIssues != null && message.accountIssues.length) + for (var i = 0; i < message.accountIssues.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.AccountIssue.encode(message.accountIssues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAccountIssuesResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse} message ListAccountIssuesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountIssuesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAccountIssuesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @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.ListAccountIssuesResponse} ListAccountIssuesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountIssuesResponse.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.ListAccountIssuesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.accountIssues && message.accountIssues.length)) + message.accountIssues = []; + message.accountIssues.push($root.google.shopping.merchant.accounts.v1beta.AccountIssue.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAccountIssuesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} ListAccountIssuesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountIssuesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAccountIssuesResponse message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAccountIssuesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accountIssues != null && message.hasOwnProperty("accountIssues")) { + if (!Array.isArray(message.accountIssues)) + return "accountIssues: array expected"; + for (var i = 0; i < message.accountIssues.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.verify(message.accountIssues[i]); + if (error) + return "accountIssues." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAccountIssuesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} ListAccountIssuesResponse + */ + ListAccountIssuesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse(); + if (object.accountIssues) { + if (!Array.isArray(object.accountIssues)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.accountIssues: array expected"); + message.accountIssues = []; + for (var i = 0; i < object.accountIssues.length; ++i) { + if (typeof object.accountIssues[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.accountIssues: object expected"); + message.accountIssues[i] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.fromObject(object.accountIssues[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAccountIssuesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} message ListAccountIssuesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAccountIssuesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accountIssues = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.accountIssues && message.accountIssues.length) { + object.accountIssues = []; + for (var j = 0; j < message.accountIssues.length; ++j) + object.accountIssues[j] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.toObject(message.accountIssues[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAccountIssuesResponse to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAccountIssuesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAccountIssuesResponse + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAccountIssuesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse"; + }; + + return ListAccountIssuesResponse; + })(); + + v1beta.AccountsService = (function() { + + /** + * Constructs a new AccountsService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an AccountsService + * @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 AccountsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AccountsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AccountsService; + + /** + * Creates new AccountsService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @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 {AccountsService} RPC service. Useful where requests and/or responses are streamed. + */ + AccountsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|getAccount}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @typedef GetAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Account} [response] Account + */ + + /** + * Calls GetAccount. + * @function getAccount + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest} request GetAccountRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountsService.GetAccountCallback} callback Node-style callback called with the error, if any, and Account + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountsService.prototype.getAccount = function getAccount(request, callback) { + return this.rpcCall(getAccount, $root.google.shopping.merchant.accounts.v1beta.GetAccountRequest, $root.google.shopping.merchant.accounts.v1beta.Account, request, callback); + }, "name", { value: "GetAccount" }); + + /** + * Calls GetAccount. + * @function getAccount + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest} request GetAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|createAndConfigureAccount}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @typedef CreateAndConfigureAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Account} [response] Account + */ + + /** + * Calls CreateAndConfigureAccount. + * @function createAndConfigureAccount + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest} request CreateAndConfigureAccountRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountsService.CreateAndConfigureAccountCallback} callback Node-style callback called with the error, if any, and Account + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountsService.prototype.createAndConfigureAccount = function createAndConfigureAccount(request, callback) { + return this.rpcCall(createAndConfigureAccount, $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest, $root.google.shopping.merchant.accounts.v1beta.Account, request, callback); + }, "name", { value: "CreateAndConfigureAccount" }); + + /** + * Calls CreateAndConfigureAccount. + * @function createAndConfigureAccount + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest} request CreateAndConfigureAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|deleteAccount}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @typedef DeleteAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAccount. + * @function deleteAccount + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest} request DeleteAccountRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountsService.DeleteAccountCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountsService.prototype.deleteAccount = function deleteAccount(request, callback) { + return this.rpcCall(deleteAccount, $root.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAccount" }); + + /** + * Calls DeleteAccount. + * @function deleteAccount + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest} request DeleteAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|updateAccount}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @typedef UpdateAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Account} [response] Account + */ + + /** + * Calls UpdateAccount. + * @function updateAccount + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest} request UpdateAccountRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountsService.UpdateAccountCallback} callback Node-style callback called with the error, if any, and Account + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountsService.prototype.updateAccount = function updateAccount(request, callback) { + return this.rpcCall(updateAccount, $root.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest, $root.google.shopping.merchant.accounts.v1beta.Account, request, callback); + }, "name", { value: "UpdateAccount" }); + + /** + * Calls UpdateAccount. + * @function updateAccount + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest} request UpdateAccountRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|listAccounts}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @typedef ListAccountsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} [response] ListAccountsResponse + */ + + /** + * Calls ListAccounts. + * @function listAccounts + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest} request ListAccountsRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountsService.ListAccountsCallback} callback Node-style callback called with the error, if any, and ListAccountsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountsService.prototype.listAccounts = function listAccounts(request, callback) { + return this.rpcCall(listAccounts, $root.google.shopping.merchant.accounts.v1beta.ListAccountsRequest, $root.google.shopping.merchant.accounts.v1beta.ListAccountsResponse, request, callback); + }, "name", { value: "ListAccounts" }); + + /** + * Calls ListAccounts. + * @function listAccounts + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest} request ListAccountsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|listSubAccounts}. + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @typedef ListSubAccountsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} [response] ListSubAccountsResponse + */ + + /** + * Calls ListSubAccounts. + * @function listSubAccounts + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest} request ListSubAccountsRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.AccountsService.ListSubAccountsCallback} callback Node-style callback called with the error, if any, and ListSubAccountsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AccountsService.prototype.listSubAccounts = function listSubAccounts(request, callback) { + return this.rpcCall(listSubAccounts, $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest, $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse, request, callback); + }, "name", { value: "ListSubAccounts" }); + + /** + * Calls ListSubAccounts. + * @function listSubAccounts + * @memberof google.shopping.merchant.accounts.v1beta.AccountsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest} request ListSubAccountsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AccountsService; + })(); + + v1beta.Account = (function() { + + /** + * Properties of an Account. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IAccount + * @property {string|null} [name] Account name + * @property {number|Long|null} [accountId] Account accountId + * @property {string|null} [accountName] Account accountName + * @property {boolean|null} [adultContent] Account adultContent + * @property {boolean|null} [testAccount] Account testAccount + * @property {google.type.ITimeZone|null} [timeZone] Account timeZone + * @property {string|null} [languageCode] Account languageCode + */ + + /** + * Constructs a new Account. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an Account. + * @implements IAccount + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IAccount=} [properties] Properties to set + */ + function Account(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]]; + } + + /** + * Account name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @instance + */ + Account.prototype.name = ""; + + /** + * Account accountId. + * @member {number|Long} accountId + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @instance + */ + Account.prototype.accountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Account accountName. + * @member {string} accountName + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @instance + */ + Account.prototype.accountName = ""; + + /** + * Account adultContent. + * @member {boolean} adultContent + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @instance + */ + Account.prototype.adultContent = false; + + /** + * Account testAccount. + * @member {boolean} testAccount + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @instance + */ + Account.prototype.testAccount = false; + + /** + * Account timeZone. + * @member {google.type.ITimeZone|null|undefined} timeZone + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @instance + */ + Account.prototype.timeZone = null; + + /** + * Account languageCode. + * @member {string} languageCode + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @instance + */ + Account.prototype.languageCode = ""; + + /** + * Creates a new Account instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccount=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Account} Account instance + */ + Account.create = function create(properties) { + return new Account(properties); + }; + + /** + * Encodes the specified Account message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Account.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccount} message Account message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Account.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.accountId != null && Object.hasOwnProperty.call(message, "accountId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.accountId); + if (message.accountName != null && Object.hasOwnProperty.call(message, "accountName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.accountName); + if (message.adultContent != null && Object.hasOwnProperty.call(message, "adultContent")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.adultContent); + if (message.testAccount != null && Object.hasOwnProperty.call(message, "testAccount")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.testAccount); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified Account message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Account.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccount} message Account message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Account.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Account message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @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.Account} Account + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Account.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.Account(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.accountId = reader.int64(); + break; + } + case 3: { + message.accountName = reader.string(); + break; + } + case 4: { + message.adultContent = reader.bool(); + break; + } + case 5: { + message.testAccount = reader.bool(); + break; + } + case 6: { + message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); + break; + } + case 7: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Account message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Account} Account + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Account.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Account message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Account.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.accountId != null && message.hasOwnProperty("accountId")) + if (!$util.isInteger(message.accountId) && !(message.accountId && $util.isInteger(message.accountId.low) && $util.isInteger(message.accountId.high))) + return "accountId: integer|Long expected"; + if (message.accountName != null && message.hasOwnProperty("accountName")) + if (!$util.isString(message.accountName)) + return "accountName: string expected"; + if (message.adultContent != null && message.hasOwnProperty("adultContent")) + if (typeof message.adultContent !== "boolean") + return "adultContent: boolean expected"; + if (message.testAccount != null && message.hasOwnProperty("testAccount")) + if (typeof message.testAccount !== "boolean") + return "testAccount: boolean expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + var error = $root.google.type.TimeZone.verify(message.timeZone); + if (error) + return "timeZone." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an Account message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Account} Account + */ + Account.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Account) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Account(); + if (object.name != null) + message.name = String(object.name); + if (object.accountId != null) + if ($util.Long) + (message.accountId = $util.Long.fromValue(object.accountId)).unsigned = false; + else if (typeof object.accountId === "string") + message.accountId = parseInt(object.accountId, 10); + else if (typeof object.accountId === "number") + message.accountId = object.accountId; + else if (typeof object.accountId === "object") + message.accountId = new $util.LongBits(object.accountId.low >>> 0, object.accountId.high >>> 0).toNumber(); + if (object.accountName != null) + message.accountName = String(object.accountName); + if (object.adultContent != null) + message.adultContent = Boolean(object.adultContent); + if (object.testAccount != null) + message.testAccount = Boolean(object.testAccount); + if (object.timeZone != null) { + if (typeof object.timeZone !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Account.timeZone: object expected"); + message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an Account message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @static + * @param {google.shopping.merchant.accounts.v1beta.Account} message Account + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Account.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.accountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.accountId = options.longs === String ? "0" : 0; + object.accountName = ""; + object.adultContent = false; + object.testAccount = false; + object.timeZone = null; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.accountId != null && message.hasOwnProperty("accountId")) + if (typeof message.accountId === "number") + object.accountId = options.longs === String ? String(message.accountId) : message.accountId; + else + object.accountId = options.longs === String ? $util.Long.prototype.toString.call(message.accountId) : options.longs === Number ? new $util.LongBits(message.accountId.low >>> 0, message.accountId.high >>> 0).toNumber() : message.accountId; + if (message.accountName != null && message.hasOwnProperty("accountName")) + object.accountName = message.accountName; + if (message.adultContent != null && message.hasOwnProperty("adultContent")) + object.adultContent = message.adultContent; + if (message.testAccount != null && message.hasOwnProperty("testAccount")) + object.testAccount = message.testAccount; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this Account to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @instance + * @returns {Object.} JSON object + */ + Account.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Account + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Account + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Account.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Account"; + }; + + return Account; + })(); + + v1beta.GetAccountRequest = (function() { + + /** + * Properties of a GetAccountRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetAccountRequest + * @property {string|null} [name] GetAccountRequest name + */ + + /** + * Constructs a new GetAccountRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetAccountRequest. + * @implements IGetAccountRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest=} [properties] Properties to set + */ + function GetAccountRequest(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]]; + } + + /** + * GetAccountRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @instance + */ + GetAccountRequest.prototype.name = ""; + + /** + * Creates a new GetAccountRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetAccountRequest} GetAccountRequest instance + */ + GetAccountRequest.create = function create(properties) { + return new GetAccountRequest(properties); + }; + + /** + * Encodes the specified GetAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest} message GetAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAccountRequest.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 GetAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest} message GetAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @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.GetAccountRequest} GetAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAccountRequest.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.GetAccountRequest(); + 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 GetAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetAccountRequest} GetAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAccountRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAccountRequest.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 GetAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetAccountRequest} GetAccountRequest + */ + GetAccountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetAccountRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetAccountRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetAccountRequest} message GetAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAccountRequest.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 GetAccountRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @instance + * @returns {Object.} JSON object + */ + GetAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAccountRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetAccountRequest"; + }; + + return GetAccountRequest; + })(); + + v1beta.CreateAndConfigureAccountRequest = (function() { + + /** + * Properties of a CreateAndConfigureAccountRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ICreateAndConfigureAccountRequest + * @property {google.shopping.merchant.accounts.v1beta.IAccount|null} [account] CreateAndConfigureAccountRequest account + * @property {Array.|null} [users] CreateAndConfigureAccountRequest users + * @property {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService|null} [acceptTermsOfService] CreateAndConfigureAccountRequest acceptTermsOfService + * @property {Array.|null} [service] CreateAndConfigureAccountRequest service + */ + + /** + * Constructs a new CreateAndConfigureAccountRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a CreateAndConfigureAccountRequest. + * @implements ICreateAndConfigureAccountRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest=} [properties] Properties to set + */ + function CreateAndConfigureAccountRequest(properties) { + this.users = []; + this.service = []; + 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]]; + } + + /** + * CreateAndConfigureAccountRequest account. + * @member {google.shopping.merchant.accounts.v1beta.IAccount|null|undefined} account + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @instance + */ + CreateAndConfigureAccountRequest.prototype.account = null; + + /** + * CreateAndConfigureAccountRequest users. + * @member {Array.} users + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @instance + */ + CreateAndConfigureAccountRequest.prototype.users = $util.emptyArray; + + /** + * CreateAndConfigureAccountRequest acceptTermsOfService. + * @member {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService|null|undefined} acceptTermsOfService + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @instance + */ + CreateAndConfigureAccountRequest.prototype.acceptTermsOfService = null; + + /** + * CreateAndConfigureAccountRequest service. + * @member {Array.} service + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @instance + */ + CreateAndConfigureAccountRequest.prototype.service = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateAndConfigureAccountRequest _acceptTermsOfService. + * @member {"acceptTermsOfService"|undefined} _acceptTermsOfService + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @instance + */ + Object.defineProperty(CreateAndConfigureAccountRequest.prototype, "_acceptTermsOfService", { + get: $util.oneOfGetter($oneOfFields = ["acceptTermsOfService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateAndConfigureAccountRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest} CreateAndConfigureAccountRequest instance + */ + CreateAndConfigureAccountRequest.create = function create(properties) { + return new CreateAndConfigureAccountRequest(properties); + }; + + /** + * Encodes the specified CreateAndConfigureAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest} message CreateAndConfigureAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAndConfigureAccountRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.account != null && Object.hasOwnProperty.call(message, "account")) + $root.google.shopping.merchant.accounts.v1beta.Account.encode(message.account, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.encode(message.users[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.acceptTermsOfService != null && Object.hasOwnProperty.call(message, "acceptTermsOfService")) + $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.encode(message.acceptTermsOfService, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.encode(message.service[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAndConfigureAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest} message CreateAndConfigureAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAndConfigureAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAndConfigureAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @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.CreateAndConfigureAccountRequest} CreateAndConfigureAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAndConfigureAccountRequest.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.CreateAndConfigureAccountRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.account = $root.google.shopping.merchant.accounts.v1beta.Account.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.users && message.users.length)) + message.users = []; + message.users.push($root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.decode(reader, reader.uint32())); + break; + } + case 3: { + message.acceptTermsOfService = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAndConfigureAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest} CreateAndConfigureAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAndConfigureAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAndConfigureAccountRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAndConfigureAccountRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.account != null && message.hasOwnProperty("account")) { + var error = $root.google.shopping.merchant.accounts.v1beta.Account.verify(message.account); + if (error) + return "account." + error; + } + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify(message.users[i]); + if (error) + return "users." + error; + } + } + if (message.acceptTermsOfService != null && message.hasOwnProperty("acceptTermsOfService")) { + properties._acceptTermsOfService = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify(message.acceptTermsOfService); + if (error) + return "acceptTermsOfService." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify(message.service[i]); + if (error) + return "service." + error; + } + } + return null; + }; + + /** + * Creates a CreateAndConfigureAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest} CreateAndConfigureAccountRequest + */ + CreateAndConfigureAccountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest(); + if (object.account != null) { + if (typeof object.account !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.account: object expected"); + message.account = $root.google.shopping.merchant.accounts.v1beta.Account.fromObject(object.account); + } + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) { + if (typeof object.users[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.users: object expected"); + message.users[i] = $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.fromObject(object.users[i]); + } + } + if (object.acceptTermsOfService != null) { + if (typeof object.acceptTermsOfService !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.acceptTermsOfService: object expected"); + message.acceptTermsOfService = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.fromObject(object.acceptTermsOfService); + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.service: object expected"); + message.service[i] = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.fromObject(object.service[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateAndConfigureAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest} message CreateAndConfigureAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAndConfigureAccountRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.users = []; + object.service = []; + } + if (options.defaults) + object.account = null; + if (message.account != null && message.hasOwnProperty("account")) + object.account = $root.google.shopping.merchant.accounts.v1beta.Account.toObject(message.account, options); + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.toObject(message.users[j], options); + } + if (message.acceptTermsOfService != null && message.hasOwnProperty("acceptTermsOfService")) { + object.acceptTermsOfService = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.toObject(message.acceptTermsOfService, options); + if (options.oneofs) + object._acceptTermsOfService = "acceptTermsOfService"; + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.toObject(message.service[j], options); + } + return object; + }; + + /** + * Converts this CreateAndConfigureAccountRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAndConfigureAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAndConfigureAccountRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAndConfigureAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest"; + }; + + CreateAndConfigureAccountRequest.AcceptTermsOfService = (function() { + + /** + * Properties of an AcceptTermsOfService. + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @interface IAcceptTermsOfService + * @property {string|null} [name] AcceptTermsOfService name + * @property {string|null} [regionCode] AcceptTermsOfService regionCode + */ + + /** + * Constructs a new AcceptTermsOfService. + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @classdesc Represents an AcceptTermsOfService. + * @implements IAcceptTermsOfService + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService=} [properties] Properties to set + */ + function AcceptTermsOfService(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]]; + } + + /** + * AcceptTermsOfService name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @instance + */ + AcceptTermsOfService.prototype.name = ""; + + /** + * AcceptTermsOfService regionCode. + * @member {string} regionCode + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @instance + */ + AcceptTermsOfService.prototype.regionCode = ""; + + /** + * Creates a new AcceptTermsOfService instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService} AcceptTermsOfService instance + */ + AcceptTermsOfService.create = function create(properties) { + return new AcceptTermsOfService(properties); + }; + + /** + * Encodes the specified AcceptTermsOfService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService} message AcceptTermsOfService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceptTermsOfService.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.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.regionCode); + return writer; + }; + + /** + * Encodes the specified AcceptTermsOfService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService} message AcceptTermsOfService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceptTermsOfService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceptTermsOfService message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @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.CreateAndConfigureAccountRequest.AcceptTermsOfService} AcceptTermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceptTermsOfService.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.CreateAndConfigureAccountRequest.AcceptTermsOfService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.regionCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceptTermsOfService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService} AcceptTermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceptTermsOfService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceptTermsOfService message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceptTermsOfService.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.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + return null; + }; + + /** + * Creates an AcceptTermsOfService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService} AcceptTermsOfService + */ + AcceptTermsOfService.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService(); + if (object.name != null) + message.name = String(object.name); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + return message; + }; + + /** + * Creates a plain object from an AcceptTermsOfService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService} message AcceptTermsOfService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceptTermsOfService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.regionCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + return object; + }; + + /** + * Converts this AcceptTermsOfService to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @instance + * @returns {Object.} JSON object + */ + AcceptTermsOfService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcceptTermsOfService + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcceptTermsOfService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService"; + }; + + return AcceptTermsOfService; + })(); + + CreateAndConfigureAccountRequest.AddAccountService = (function() { + + /** + * Properties of an AddAccountService. + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @interface IAddAccountService + * @property {google.shopping.merchant.accounts.v1beta.IAccountAggregation|null} [accountAggregation] AddAccountService accountAggregation + * @property {string|null} [provider] AddAccountService provider + */ + + /** + * Constructs a new AddAccountService. + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest + * @classdesc Represents an AddAccountService. + * @implements IAddAccountService + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService=} [properties] Properties to set + */ + function AddAccountService(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]]; + } + + /** + * AddAccountService accountAggregation. + * @member {google.shopping.merchant.accounts.v1beta.IAccountAggregation|null|undefined} accountAggregation + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @instance + */ + AddAccountService.prototype.accountAggregation = null; + + /** + * AddAccountService provider. + * @member {string|null|undefined} provider + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @instance + */ + AddAccountService.prototype.provider = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddAccountService serviceType. + * @member {"accountAggregation"|undefined} serviceType + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @instance + */ + Object.defineProperty(AddAccountService.prototype, "serviceType", { + get: $util.oneOfGetter($oneOfFields = ["accountAggregation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddAccountService _provider. + * @member {"provider"|undefined} _provider + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @instance + */ + Object.defineProperty(AddAccountService.prototype, "_provider", { + get: $util.oneOfGetter($oneOfFields = ["provider"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddAccountService instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService} AddAccountService instance + */ + AddAccountService.create = function create(properties) { + return new AddAccountService(properties); + }; + + /** + * Encodes the specified AddAccountService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService} message AddAccountService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddAccountService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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.shopping.merchant.accounts.v1beta.AccountAggregation.encode(message.accountAggregation, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddAccountService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService} message AddAccountService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddAccountService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddAccountService message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @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.CreateAndConfigureAccountRequest.AddAccountService} AddAccountService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddAccountService.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.CreateAndConfigureAccountRequest.AddAccountService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 103: { + message.accountAggregation = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.decode(reader, reader.uint32()); + break; + } + case 1: { + message.provider = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddAccountService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService} AddAccountService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddAccountService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddAccountService message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddAccountService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accountAggregation != null && message.hasOwnProperty("accountAggregation")) { + properties.serviceType = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.verify(message.accountAggregation); + if (error) + return "accountAggregation." + error; + } + } + if (message.provider != null && message.hasOwnProperty("provider")) { + properties._provider = 1; + if (!$util.isString(message.provider)) + return "provider: string expected"; + } + return null; + }; + + /** + * Creates an AddAccountService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService} AddAccountService + */ + AddAccountService.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService(); + 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.shopping.merchant.accounts.v1beta.AccountAggregation.fromObject(object.accountAggregation); + } + if (object.provider != null) + message.provider = String(object.provider); + return message; + }; + + /** + * Creates a plain object from an AddAccountService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService} message AddAccountService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddAccountService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.provider != null && message.hasOwnProperty("provider")) { + object.provider = message.provider; + if (options.oneofs) + object._provider = "provider"; + } + if (message.accountAggregation != null && message.hasOwnProperty("accountAggregation")) { + object.accountAggregation = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.toObject(message.accountAggregation, options); + if (options.oneofs) + object.serviceType = "accountAggregation"; + } + return object; + }; + + /** + * Converts this AddAccountService to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @instance + * @returns {Object.} JSON object + */ + AddAccountService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AddAccountService + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddAccountService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService"; + }; + + return AddAccountService; + })(); + + return CreateAndConfigureAccountRequest; + })(); + + v1beta.DeleteAccountRequest = (function() { + + /** + * Properties of a DeleteAccountRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IDeleteAccountRequest + * @property {string|null} [name] DeleteAccountRequest name + */ + + /** + * Constructs a new DeleteAccountRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a DeleteAccountRequest. + * @implements IDeleteAccountRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest=} [properties] Properties to set + */ + function DeleteAccountRequest(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]]; + } + + /** + * DeleteAccountRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @instance + */ + DeleteAccountRequest.prototype.name = ""; + + /** + * Creates a new DeleteAccountRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.DeleteAccountRequest} DeleteAccountRequest instance + */ + DeleteAccountRequest.create = function create(properties) { + return new DeleteAccountRequest(properties); + }; + + /** + * Encodes the specified DeleteAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteAccountRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest} message DeleteAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAccountRequest.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 DeleteAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest} message DeleteAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @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.DeleteAccountRequest} DeleteAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAccountRequest.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.DeleteAccountRequest(); + 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 DeleteAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.DeleteAccountRequest} DeleteAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAccountRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAccountRequest.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 DeleteAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.DeleteAccountRequest} DeleteAccountRequest + */ + DeleteAccountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.DeleteAccountRequest} message DeleteAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAccountRequest.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 DeleteAccountRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAccountRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DeleteAccountRequest"; + }; + + return DeleteAccountRequest; + })(); + + v1beta.UpdateAccountRequest = (function() { + + /** + * Properties of an UpdateAccountRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUpdateAccountRequest + * @property {google.shopping.merchant.accounts.v1beta.IAccount|null} [account] UpdateAccountRequest account + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAccountRequest updateMask + */ + + /** + * Constructs a new UpdateAccountRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UpdateAccountRequest. + * @implements IUpdateAccountRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest=} [properties] Properties to set + */ + function UpdateAccountRequest(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]]; + } + + /** + * UpdateAccountRequest account. + * @member {google.shopping.merchant.accounts.v1beta.IAccount|null|undefined} account + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @instance + */ + UpdateAccountRequest.prototype.account = null; + + /** + * UpdateAccountRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @instance + */ + UpdateAccountRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAccountRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountRequest} UpdateAccountRequest instance + */ + UpdateAccountRequest.create = function create(properties) { + return new UpdateAccountRequest(properties); + }; + + /** + * Encodes the specified UpdateAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest} message UpdateAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAccountRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.account != null && Object.hasOwnProperty.call(message, "account")) + $root.google.shopping.merchant.accounts.v1beta.Account.encode(message.account, 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 UpdateAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest} message UpdateAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @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.UpdateAccountRequest} UpdateAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAccountRequest.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.UpdateAccountRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.account = $root.google.shopping.merchant.accounts.v1beta.Account.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 UpdateAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountRequest} UpdateAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAccountRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAccountRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.account != null && message.hasOwnProperty("account")) { + var error = $root.google.shopping.merchant.accounts.v1beta.Account.verify(message.account); + if (error) + return "account." + 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 UpdateAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountRequest} UpdateAccountRequest + */ + UpdateAccountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest(); + if (object.account != null) { + if (typeof object.account !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.account: object expected"); + message.account = $root.google.shopping.merchant.accounts.v1beta.Account.fromObject(object.account); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UpdateAccountRequest} message UpdateAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAccountRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.account = null; + object.updateMask = null; + } + if (message.account != null && message.hasOwnProperty("account")) + object.account = $root.google.shopping.merchant.accounts.v1beta.Account.toObject(message.account, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAccountRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAccountRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateAccountRequest"; + }; + + return UpdateAccountRequest; + })(); + + v1beta.ListAccountsRequest = (function() { + + /** + * Properties of a ListAccountsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListAccountsRequest + * @property {number|null} [pageSize] ListAccountsRequest pageSize + * @property {string|null} [pageToken] ListAccountsRequest pageToken + * @property {string|null} [filter] ListAccountsRequest filter + */ + + /** + * Constructs a new ListAccountsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListAccountsRequest. + * @implements IListAccountsRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest=} [properties] Properties to set + */ + function ListAccountsRequest(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]]; + } + + /** + * ListAccountsRequest pageSize. + * @member {number} pageSize + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @instance + */ + ListAccountsRequest.prototype.pageSize = 0; + + /** + * ListAccountsRequest pageToken. + * @member {string} pageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @instance + */ + ListAccountsRequest.prototype.pageToken = ""; + + /** + * ListAccountsRequest filter. + * @member {string} filter + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @instance + */ + ListAccountsRequest.prototype.filter = ""; + + /** + * Creates a new ListAccountsRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsRequest} ListAccountsRequest instance + */ + ListAccountsRequest.create = function create(properties) { + return new ListAccountsRequest(properties); + }; + + /** + * Encodes the specified ListAccountsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest} message ListAccountsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListAccountsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest} message ListAccountsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAccountsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @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.ListAccountsRequest} ListAccountsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountsRequest.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.ListAccountsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAccountsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsRequest} ListAccountsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAccountsRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAccountsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListAccountsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsRequest} ListAccountsRequest + */ + ListAccountsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountsRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountsRequest(); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListAccountsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListAccountsRequest} message ListAccountsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAccountsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListAccountsRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAccountsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAccountsRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAccountsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountsRequest"; + }; + + return ListAccountsRequest; + })(); + + v1beta.ListAccountsResponse = (function() { + + /** + * Properties of a ListAccountsResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListAccountsResponse + * @property {Array.|null} [accounts] ListAccountsResponse accounts + * @property {string|null} [nextPageToken] ListAccountsResponse nextPageToken + */ + + /** + * Constructs a new ListAccountsResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListAccountsResponse. + * @implements IListAccountsResponse + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsResponse=} [properties] Properties to set + */ + function ListAccountsResponse(properties) { + this.accounts = []; + 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]]; + } + + /** + * ListAccountsResponse accounts. + * @member {Array.} accounts + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @instance + */ + ListAccountsResponse.prototype.accounts = $util.emptyArray; + + /** + * ListAccountsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @instance + */ + ListAccountsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAccountsResponse instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsResponse=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} ListAccountsResponse instance + */ + ListAccountsResponse.create = function create(properties) { + return new ListAccountsResponse(properties); + }; + + /** + * Encodes the specified ListAccountsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsResponse.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsResponse} message ListAccountsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accounts != null && message.accounts.length) + for (var i = 0; i < message.accounts.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Account.encode(message.accounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAccountsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListAccountsResponse} message ListAccountsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAccountsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAccountsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @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.ListAccountsResponse} ListAccountsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountsResponse.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.ListAccountsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.accounts && message.accounts.length)) + message.accounts = []; + message.accounts.push($root.google.shopping.merchant.accounts.v1beta.Account.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAccountsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} ListAccountsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAccountsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAccountsResponse message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAccountsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accounts != null && message.hasOwnProperty("accounts")) { + if (!Array.isArray(message.accounts)) + return "accounts: array expected"; + for (var i = 0; i < message.accounts.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Account.verify(message.accounts[i]); + if (error) + return "accounts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAccountsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} ListAccountsResponse + */ + ListAccountsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountsResponse) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountsResponse(); + if (object.accounts) { + if (!Array.isArray(object.accounts)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountsResponse.accounts: array expected"); + message.accounts = []; + for (var i = 0; i < object.accounts.length; ++i) { + if (typeof object.accounts[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountsResponse.accounts: object expected"); + message.accounts[i] = $root.google.shopping.merchant.accounts.v1beta.Account.fromObject(object.accounts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAccountsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} message ListAccountsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAccountsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accounts = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.accounts && message.accounts.length) { + object.accounts = []; + for (var j = 0; j < message.accounts.length; ++j) + object.accounts[j] = $root.google.shopping.merchant.accounts.v1beta.Account.toObject(message.accounts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAccountsResponse to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAccountsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAccountsResponse + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAccountsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountsResponse"; + }; + + return ListAccountsResponse; + })(); + + v1beta.ListSubAccountsRequest = (function() { + + /** + * Properties of a ListSubAccountsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListSubAccountsRequest + * @property {string|null} [provider] ListSubAccountsRequest provider + * @property {number|null} [pageSize] ListSubAccountsRequest pageSize + * @property {string|null} [pageToken] ListSubAccountsRequest pageToken + */ + + /** + * Constructs a new ListSubAccountsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListSubAccountsRequest. + * @implements IListSubAccountsRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest=} [properties] Properties to set + */ + function ListSubAccountsRequest(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]]; + } + + /** + * ListSubAccountsRequest provider. + * @member {string} provider + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @instance + */ + ListSubAccountsRequest.prototype.provider = ""; + + /** + * ListSubAccountsRequest pageSize. + * @member {number} pageSize + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @instance + */ + ListSubAccountsRequest.prototype.pageSize = 0; + + /** + * ListSubAccountsRequest pageToken. + * @member {string} pageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @instance + */ + ListSubAccountsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSubAccountsRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest} ListSubAccountsRequest instance + */ + ListSubAccountsRequest.create = function create(properties) { + return new ListSubAccountsRequest(properties); + }; + + /** + * Encodes the specified ListSubAccountsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest} message ListSubAccountsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubAccountsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.provider); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListSubAccountsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest} message ListSubAccountsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubAccountsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubAccountsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @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.ListSubAccountsRequest} ListSubAccountsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubAccountsRequest.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.ListSubAccountsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.provider = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubAccountsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest} ListSubAccountsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubAccountsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubAccountsRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubAccountsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.provider != null && message.hasOwnProperty("provider")) + if (!$util.isString(message.provider)) + return "provider: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSubAccountsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest} ListSubAccountsRequest + */ + ListSubAccountsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest(); + if (object.provider != null) + message.provider = String(object.provider); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSubAccountsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest} message ListSubAccountsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubAccountsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.provider = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.provider != null && message.hasOwnProperty("provider")) + object.provider = message.provider; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListSubAccountsRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSubAccountsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubAccountsRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubAccountsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest"; + }; + + return ListSubAccountsRequest; + })(); + + v1beta.ListSubAccountsResponse = (function() { + + /** + * Properties of a ListSubAccountsResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListSubAccountsResponse + * @property {Array.|null} [accounts] ListSubAccountsResponse accounts + * @property {string|null} [nextPageToken] ListSubAccountsResponse nextPageToken + */ + + /** + * Constructs a new ListSubAccountsResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListSubAccountsResponse. + * @implements IListSubAccountsResponse + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse=} [properties] Properties to set + */ + function ListSubAccountsResponse(properties) { + this.accounts = []; + 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]]; + } + + /** + * ListSubAccountsResponse accounts. + * @member {Array.} accounts + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @instance + */ + ListSubAccountsResponse.prototype.accounts = $util.emptyArray; + + /** + * ListSubAccountsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @instance + */ + ListSubAccountsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSubAccountsResponse instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} ListSubAccountsResponse instance + */ + ListSubAccountsResponse.create = function create(properties) { + return new ListSubAccountsResponse(properties); + }; + + /** + * Encodes the specified ListSubAccountsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse} message ListSubAccountsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubAccountsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accounts != null && message.accounts.length) + for (var i = 0; i < message.accounts.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Account.encode(message.accounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSubAccountsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse} message ListSubAccountsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubAccountsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubAccountsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @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.ListSubAccountsResponse} ListSubAccountsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubAccountsResponse.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.ListSubAccountsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.accounts && message.accounts.length)) + message.accounts = []; + message.accounts.push($root.google.shopping.merchant.accounts.v1beta.Account.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubAccountsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} ListSubAccountsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubAccountsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubAccountsResponse message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubAccountsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accounts != null && message.hasOwnProperty("accounts")) { + if (!Array.isArray(message.accounts)) + return "accounts: array expected"; + for (var i = 0; i < message.accounts.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Account.verify(message.accounts[i]); + if (error) + return "accounts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSubAccountsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} ListSubAccountsResponse + */ + ListSubAccountsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse(); + if (object.accounts) { + if (!Array.isArray(object.accounts)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.accounts: array expected"); + message.accounts = []; + for (var i = 0; i < object.accounts.length; ++i) { + if (typeof object.accounts[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.accounts: object expected"); + message.accounts[i] = $root.google.shopping.merchant.accounts.v1beta.Account.fromObject(object.accounts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSubAccountsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} message ListSubAccountsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubAccountsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accounts = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.accounts && message.accounts.length) { + object.accounts = []; + for (var j = 0; j < message.accounts.length; ++j) + object.accounts[j] = $root.google.shopping.merchant.accounts.v1beta.Account.toObject(message.accounts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSubAccountsResponse to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSubAccountsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubAccountsResponse + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubAccountsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse"; + }; + + 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() { + + /** + * Constructs a new UserService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a UserService + * @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 UserService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (UserService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserService; + + /** + * Creates new UserService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @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 {UserService} RPC service. Useful where requests and/or responses are streamed. + */ + UserService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|getUser}. + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @typedef GetUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.User} [response] User + */ + + /** + * Calls GetUser. + * @function getUser + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest} request GetUserRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.UserService.GetUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserService.prototype.getUser = function getUser(request, callback) { + return this.rpcCall(getUser, $root.google.shopping.merchant.accounts.v1beta.GetUserRequest, $root.google.shopping.merchant.accounts.v1beta.User, request, callback); + }, "name", { value: "GetUser" }); + + /** + * Calls GetUser. + * @function getUser + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest} request GetUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|createUser}. + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @typedef CreateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.User} [response] User + */ + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.UserService.CreateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserService.prototype.createUser = function createUser(request, callback) { + return this.rpcCall(createUser, $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest, $root.google.shopping.merchant.accounts.v1beta.User, request, callback); + }, "name", { value: "CreateUser" }); + + /** + * Calls CreateUser. + * @function createUser + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|deleteUser}. + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @typedef DeleteUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.UserService.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserService.prototype.deleteUser = function deleteUser(request, callback) { + return this.rpcCall(deleteUser, $root.google.shopping.merchant.accounts.v1beta.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteUser" }); + + /** + * Calls DeleteUser. + * @function deleteUser + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|updateUser}. + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @typedef UpdateUserCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.User} [response] User + */ + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.UserService.UpdateUserCallback} callback Node-style callback called with the error, if any, and User + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserService.prototype.updateUser = function updateUser(request, callback) { + return this.rpcCall(updateUser, $root.google.shopping.merchant.accounts.v1beta.UpdateUserRequest, $root.google.shopping.merchant.accounts.v1beta.User, request, callback); + }, "name", { value: "UpdateUser" }); + + /** + * Calls UpdateUser. + * @function updateUser + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|listUsers}. + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @typedef ListUsersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ListUsersResponse} [response] ListUsersResponse + */ + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest} request ListUsersRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.UserService.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UserService.prototype.listUsers = function listUsers(request, callback) { + return this.rpcCall(listUsers, $root.google.shopping.merchant.accounts.v1beta.ListUsersRequest, $root.google.shopping.merchant.accounts.v1beta.ListUsersResponse, request, callback); + }, "name", { value: "ListUsers" }); + + /** + * Calls ListUsers. + * @function listUsers + * @memberof google.shopping.merchant.accounts.v1beta.UserService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest} request ListUsersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return UserService; + })(); + + v1beta.User = (function() { + + /** + * Properties of a User. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUser + * @property {string|null} [name] User name + * @property {google.shopping.merchant.accounts.v1beta.User.State|null} [state] User state + * @property {Array.|null} [accessRights] User accessRights + */ + + /** + * Constructs a new User. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a User. + * @implements IUser + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUser=} [properties] Properties to set + */ + function User(properties) { + this.accessRights = []; + 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]]; + } + + /** + * User name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.User + * @instance + */ + User.prototype.name = ""; + + /** + * User state. + * @member {google.shopping.merchant.accounts.v1beta.User.State} state + * @memberof google.shopping.merchant.accounts.v1beta.User + * @instance + */ + User.prototype.state = 0; + + /** + * User accessRights. + * @member {Array.} accessRights + * @memberof google.shopping.merchant.accounts.v1beta.User + * @instance + */ + User.prototype.accessRights = $util.emptyArray; + + /** + * Creates a new User instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.User + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUser=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.User} User instance + */ + User.create = function create(properties) { + return new User(properties); + }; + + /** + * Encodes the specified User message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.User.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.User + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.accessRights != null && message.accessRights.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.accessRights.length; ++i) + writer.int32(message.accessRights[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified User message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.User.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.User + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUser} message User message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + User.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a User message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.User + * @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.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.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.User(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 4: { + if (!(message.accessRights && message.accessRights.length)) + message.accessRights = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.accessRights.push(reader.int32()); + } else + message.accessRights.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a User message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.User + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.User} User + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + User.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a User message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.User + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + User.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.accessRights != null && message.hasOwnProperty("accessRights")) { + if (!Array.isArray(message.accessRights)) + return "accessRights: array expected"; + for (var i = 0; i < message.accessRights.length; ++i) + switch (message.accessRights[i]) { + default: + return "accessRights: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a User message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.User + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.User} User + */ + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.User) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.User(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "VERIFIED": + case 2: + message.state = 2; + break; + } + if (object.accessRights) { + if (!Array.isArray(object.accessRights)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.User.accessRights: array expected"); + message.accessRights = []; + for (var i = 0; i < object.accessRights.length; ++i) + switch (object.accessRights[i]) { + default: + if (typeof object.accessRights[i] === "number") { + message.accessRights[i] = object.accessRights[i]; + break; + } + case "ACCESS_RIGHT_UNSPECIFIED": + case 0: + message.accessRights[i] = 0; + break; + case "STANDARD": + case 1: + message.accessRights[i] = 1; + break; + case "ADMIN": + case 2: + message.accessRights[i] = 2; + break; + case "PERFORMANCE_REPORTING": + case 3: + message.accessRights[i] = 3; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a User message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.User + * @static + * @param {google.shopping.merchant.accounts.v1beta.User} message User + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + User.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accessRights = []; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.User.State[message.state] === undefined ? message.state : $root.google.shopping.merchant.accounts.v1beta.User.State[message.state] : message.state; + if (message.accessRights && message.accessRights.length) { + object.accessRights = []; + for (var j = 0; j < message.accessRights.length; ++j) + object.accessRights[j] = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.AccessRight[message.accessRights[j]] === undefined ? message.accessRights[j] : $root.google.shopping.merchant.accounts.v1beta.AccessRight[message.accessRights[j]] : message.accessRights[j]; + } + return object; + }; + + /** + * Converts this User to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.User + * @instance + * @returns {Object.} JSON object + */ + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for User + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.User + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.User"; + }; + + /** + * State enum. + * @name google.shopping.merchant.accounts.v1beta.User.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} VERIFIED=2 VERIFIED value + */ + User.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "VERIFIED"] = 2; + return values; + })(); + + return User; + })(); + + v1beta.GetUserRequest = (function() { + + /** + * Properties of a GetUserRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetUserRequest + * @property {string|null} [name] GetUserRequest name + */ + + /** + * Constructs a new GetUserRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetUserRequest. + * @implements IGetUserRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest=} [properties] Properties to set + */ + function GetUserRequest(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]]; + } + + /** + * GetUserRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @instance + */ + GetUserRequest.prototype.name = ""; + + /** + * Creates a new GetUserRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetUserRequest} GetUserRequest instance + */ + GetUserRequest.create = function create(properties) { + return new GetUserRequest(properties); + }; + + /** + * Encodes the specified GetUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetUserRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.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 GetUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @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.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.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.GetUserRequest(); + 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 GetUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetUserRequest} GetUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUserRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUserRequest.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 GetUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetUserRequest} GetUserRequest + */ + GetUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetUserRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetUserRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetUserRequest} message GetUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUserRequest.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 GetUserRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @instance + * @returns {Object.} JSON object + */ + GetUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUserRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetUserRequest"; + }; + + return GetUserRequest; + })(); + + v1beta.CreateUserRequest = (function() { + + /** + * Properties of a CreateUserRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ICreateUserRequest + * @property {string|null} [parent] CreateUserRequest parent + * @property {string|null} [userId] CreateUserRequest userId + * @property {google.shopping.merchant.accounts.v1beta.IUser|null} [user] CreateUserRequest user + */ + + /** + * Constructs a new CreateUserRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a CreateUserRequest. + * @implements ICreateUserRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest=} [properties] Properties to set + */ + function CreateUserRequest(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]]; + } + + /** + * CreateUserRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.parent = ""; + + /** + * CreateUserRequest userId. + * @member {string} userId + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.userId = ""; + + /** + * CreateUserRequest user. + * @member {google.shopping.merchant.accounts.v1beta.IUser|null|undefined} user + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @instance + */ + CreateUserRequest.prototype.user = null; + + /** + * Creates a new CreateUserRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.CreateUserRequest} CreateUserRequest instance + */ + CreateUserRequest.create = function create(properties) { + return new CreateUserRequest(properties); + }; + + /** + * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.shopping.merchant.accounts.v1beta.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @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.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.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.CreateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.userId = reader.string(); + break; + } + case 3: { + message.user = $root.google.shopping.merchant.accounts.v1beta.User.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.CreateUserRequest} CreateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUserRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.userId != null && message.hasOwnProperty("userId")) + if (!$util.isString(message.userId)) + return "userId: string expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.shopping.merchant.accounts.v1beta.User.verify(message.user); + if (error) + return "user." + error; + } + return null; + }; + + /** + * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.CreateUserRequest} CreateUserRequest + */ + CreateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.userId != null) + message.userId = String(object.userId); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateUserRequest.user: object expected"); + message.user = $root.google.shopping.merchant.accounts.v1beta.User.fromObject(object.user); + } + return message; + }; + + /** + * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateUserRequest} message CreateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.userId = ""; + object.user = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.userId != null && message.hasOwnProperty("userId")) + object.userId = message.userId; + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.shopping.merchant.accounts.v1beta.User.toObject(message.user, options); + return object; + }; + + /** + * Converts this CreateUserRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUserRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateUserRequest"; + }; + + return CreateUserRequest; + })(); + + v1beta.DeleteUserRequest = (function() { + + /** + * Properties of a DeleteUserRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IDeleteUserRequest + * @property {string|null} [name] DeleteUserRequest name + */ + + /** + * Constructs a new DeleteUserRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a DeleteUserRequest. + * @implements IDeleteUserRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest=} [properties] Properties to set + */ + function DeleteUserRequest(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]]; + } + + /** + * DeleteUserRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @instance + */ + DeleteUserRequest.prototype.name = ""; + + /** + * Creates a new DeleteUserRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.DeleteUserRequest} DeleteUserRequest instance + */ + DeleteUserRequest.create = function create(properties) { + return new DeleteUserRequest(properties); + }; + + /** + * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteUserRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.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 DeleteUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @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.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.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.DeleteUserRequest(); + 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 DeleteUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.DeleteUserRequest} DeleteUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUserRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUserRequest.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 DeleteUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.DeleteUserRequest} DeleteUserRequest + */ + DeleteUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DeleteUserRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.DeleteUserRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.DeleteUserRequest} message DeleteUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUserRequest.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 DeleteUserRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteUserRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DeleteUserRequest"; + }; + + return DeleteUserRequest; + })(); + + v1beta.UpdateUserRequest = (function() { + + /** + * Properties of an UpdateUserRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUpdateUserRequest + * @property {google.shopping.merchant.accounts.v1beta.IUser|null} [user] UpdateUserRequest user + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask + */ + + /** + * Constructs a new UpdateUserRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UpdateUserRequest. + * @implements IUpdateUserRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest=} [properties] Properties to set + */ + function UpdateUserRequest(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]]; + } + + /** + * UpdateUserRequest user. + * @member {google.shopping.merchant.accounts.v1beta.IUser|null|undefined} user + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.user = null; + + /** + * UpdateUserRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @instance + */ + UpdateUserRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateUserRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UpdateUserRequest} UpdateUserRequest instance + */ + UpdateUserRequest.create = function create(properties) { + return new UpdateUserRequest(properties); + }; + + /** + * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateUserRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.shopping.merchant.accounts.v1beta.User.encode(message.user, 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 UpdateUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateUserRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUserRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @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.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.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.UpdateUserRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.user = $root.google.shopping.merchant.accounts.v1beta.User.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 UpdateUserRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UpdateUserRequest} UpdateUserRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUserRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUserRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.shopping.merchant.accounts.v1beta.User.verify(message.user); + if (error) + return "user." + 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 UpdateUserRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UpdateUserRequest} UpdateUserRequest + */ + UpdateUserRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateUserRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateUserRequest(); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateUserRequest.user: object expected"); + message.user = $root.google.shopping.merchant.accounts.v1beta.User.fromObject(object.user); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateUserRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UpdateUserRequest} message UpdateUserRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUserRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.user = null; + object.updateMask = null; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.shopping.merchant.accounts.v1beta.User.toObject(message.user, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateUserRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUserRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateUserRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateUserRequest"; + }; + + return UpdateUserRequest; + })(); + + v1beta.ListUsersRequest = (function() { + + /** + * Properties of a ListUsersRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListUsersRequest + * @property {string|null} [parent] ListUsersRequest parent + * @property {number|null} [pageSize] ListUsersRequest pageSize + * @property {string|null} [pageToken] ListUsersRequest pageToken + */ + + /** + * Constructs a new ListUsersRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListUsersRequest. + * @implements IListUsersRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest=} [properties] Properties to set + */ + function ListUsersRequest(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]]; + } + + /** + * ListUsersRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.parent = ""; + + /** + * ListUsersRequest pageSize. + * @member {number} pageSize + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageSize = 0; + + /** + * ListUsersRequest pageToken. + * @member {string} pageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @instance + */ + ListUsersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListUsersRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListUsersRequest} ListUsersRequest instance + */ + ListUsersRequest.create = function create(properties) { + return new ListUsersRequest(properties); + }; + + /** + * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @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.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.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.ListUsersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListUsersRequest} ListUsersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListUsersRequest} ListUsersRequest + */ + ListUsersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListUsersRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListUsersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListUsersRequest} message ListUsersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListUsersRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @instance + * @returns {Object.} JSON object + */ + ListUsersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListUsersRequest"; + }; + + return ListUsersRequest; + })(); + + v1beta.ListUsersResponse = (function() { + + /** + * Properties of a ListUsersResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListUsersResponse + * @property {Array.|null} [users] ListUsersResponse users + * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken + */ + + /** + * Constructs a new ListUsersResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListUsersResponse. + * @implements IListUsersResponse + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListUsersResponse=} [properties] Properties to set + */ + function ListUsersResponse(properties) { + this.users = []; + 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]]; + } + + /** + * ListUsersResponse users. + * @member {Array.} users + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.users = $util.emptyArray; + + /** + * ListUsersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @instance + */ + ListUsersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListUsersResponse instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListUsersResponse=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListUsersResponse} ListUsersResponse instance + */ + ListUsersResponse.create = function create(properties) { + return new ListUsersResponse(properties); + }; + + /** + * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersResponse.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @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.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.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.ListUsersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.users && message.users.length)) + message.users = []; + message.users.push($root.google.shopping.merchant.accounts.v1beta.User.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListUsersResponse} ListUsersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsersResponse message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.User.verify(message.users[i]); + if (error) + return "users." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListUsersResponse} ListUsersResponse + */ + ListUsersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListUsersResponse) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListUsersResponse(); + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListUsersResponse.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) { + if (typeof object.users[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListUsersResponse.users: object expected"); + message.users[i] = $root.google.shopping.merchant.accounts.v1beta.User.fromObject(object.users[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListUsersResponse} message ListUsersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.users = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = $root.google.shopping.merchant.accounts.v1beta.User.toObject(message.users[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListUsersResponse to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @instance + * @returns {Object.} JSON object + */ + ListUsersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsersResponse + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListUsersResponse"; + }; + + return ListUsersResponse; + })(); + + v1beta.AutofeedSettingsService = (function() { + + /** + * Constructs a new AutofeedSettingsService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @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 AutofeedSettingsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AutofeedSettingsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutofeedSettingsService; + + /** + * Creates new AutofeedSettingsService service using the specified rpc implementation. + * @function create + * @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 {AutofeedSettingsService} RPC service. Useful where requests and/or responses are streamed. + */ + AutofeedSettingsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * 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.AutofeedSettings} [response] AutofeedSettings + */ + + /** + * Calls GetAutofeedSettings. + * @function getAutofeedSettings + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService + * @instance + * @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(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 GetAutofeedSettings. + * @function getAutofeedSettings + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService + * @instance + * @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.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.AutofeedSettings} [response] AutofeedSettings + */ + + /** + * Calls UpdateAutofeedSettings. + * @function updateAutofeedSettings + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService + * @instance + * @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(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 UpdateAutofeedSettings. + * @function updateAutofeedSettings + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest} request UpdateAutofeedSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AutofeedSettingsService; + })(); + + v1beta.AutofeedSettings = (function() { + + /** + * Properties of an AutofeedSettings. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IAutofeedSettings + * @property {string|null} [name] AutofeedSettings name + * @property {boolean|null} [enableProducts] AutofeedSettings enableProducts + * @property {boolean|null} [eligible] AutofeedSettings eligible + */ + + /** + * Constructs a new AutofeedSettings. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an AutofeedSettings. + * @implements IAutofeedSettings + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IAutofeedSettings=} [properties] Properties to set + */ + function AutofeedSettings(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]]; + } + + /** + * AutofeedSettings name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @instance + */ + AutofeedSettings.prototype.name = ""; + + /** + * AutofeedSettings enableProducts. + * @member {boolean} enableProducts + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @instance + */ + AutofeedSettings.prototype.enableProducts = false; + + /** + * AutofeedSettings eligible. + * @member {boolean} eligible + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @instance + */ + AutofeedSettings.prototype.eligible = false; + + /** + * Creates a new AutofeedSettings instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAutofeedSettings=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.AutofeedSettings} AutofeedSettings instance + */ + AutofeedSettings.create = function create(properties) { + return new AutofeedSettings(properties); + }; + + /** + * 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.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.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.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(); + if (message.womenOwned != null && Object.hasOwnProperty.call(message, "womenOwned")) + $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.encode(message.womenOwned, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.veteranOwned != null && Object.hasOwnProperty.call(message, "veteranOwned")) + $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.encode(message.veteranOwned, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.latinoOwned != null && Object.hasOwnProperty.call(message, "latinoOwned")) + $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.encode(message.latinoOwned, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.smallBusiness != null && Object.hasOwnProperty.call(message, "smallBusiness")) + $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.encode(message.smallBusiness, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BusinessIdentity message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify|verify} messages. + * @function encodeDelimited + * @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.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BusinessIdentity message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @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.BusinessIdentity} BusinessIdentity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BusinessIdentity.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.BusinessIdentity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.promotionsConsent = reader.int32(); + break; + } + case 3: { + message.blackOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); + break; + } + case 4: { + message.womenOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); + break; + } + case 5: { + message.veteranOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); + break; + } + case 6: { + message.latinoOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); + break; + } + case 7: { + message.smallBusiness = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BusinessIdentity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity} BusinessIdentity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BusinessIdentity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BusinessIdentity message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BusinessIdentity.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.promotionsConsent != null && message.hasOwnProperty("promotionsConsent")) + switch (message.promotionsConsent) { + default: + return "promotionsConsent: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.blackOwned != null && message.hasOwnProperty("blackOwned")) { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.blackOwned); + if (error) + return "blackOwned." + error; + } + if (message.womenOwned != null && message.hasOwnProperty("womenOwned")) { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.womenOwned); + if (error) + return "womenOwned." + error; + } + if (message.veteranOwned != null && message.hasOwnProperty("veteranOwned")) { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.veteranOwned); + if (error) + return "veteranOwned." + error; + } + if (message.latinoOwned != null && message.hasOwnProperty("latinoOwned")) { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.latinoOwned); + if (error) + return "latinoOwned." + error; + } + if (message.smallBusiness != null && message.hasOwnProperty("smallBusiness")) { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.smallBusiness); + if (error) + return "smallBusiness." + error; + } + return null; + }; + + /** + * Creates a BusinessIdentity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity} BusinessIdentity + */ + BusinessIdentity.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity(); + if (object.name != null) + message.name = String(object.name); + switch (object.promotionsConsent) { + default: + if (typeof object.promotionsConsent === "number") { + message.promotionsConsent = object.promotionsConsent; + break; + } + break; + case "PROMOTIONS_CONSENT_UNSPECIFIED": + case 0: + message.promotionsConsent = 0; + break; + case "PROMOTIONS_CONSENT_GIVEN": + case 1: + message.promotionsConsent = 1; + break; + case "PROMOTIONS_CONSENT_DENIED": + case 2: + message.promotionsConsent = 2; + break; + } + if (object.blackOwned != null) { + if (typeof object.blackOwned !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.blackOwned: object expected"); + message.blackOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.blackOwned); + } + if (object.womenOwned != null) { + if (typeof object.womenOwned !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.womenOwned: object expected"); + message.womenOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.womenOwned); + } + if (object.veteranOwned != null) { + if (typeof object.veteranOwned !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.veteranOwned: object expected"); + message.veteranOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.veteranOwned); + } + if (object.latinoOwned != null) { + if (typeof object.latinoOwned !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.latinoOwned: object expected"); + message.latinoOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.latinoOwned); + } + if (object.smallBusiness != null) { + if (typeof object.smallBusiness !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.smallBusiness: object expected"); + message.smallBusiness = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.smallBusiness); + } + return message; + }; + + /** + * Creates a plain object from a BusinessIdentity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @static + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity} message BusinessIdentity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BusinessIdentity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.promotionsConsent = options.enums === String ? "PROMOTIONS_CONSENT_UNSPECIFIED" : 0; + object.blackOwned = null; + object.womenOwned = null; + object.veteranOwned = null; + object.latinoOwned = null; + object.smallBusiness = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.promotionsConsent != null && message.hasOwnProperty("promotionsConsent")) + object.promotionsConsent = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent[message.promotionsConsent] === undefined ? message.promotionsConsent : $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent[message.promotionsConsent] : message.promotionsConsent; + if (message.blackOwned != null && message.hasOwnProperty("blackOwned")) + object.blackOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.blackOwned, options); + if (message.womenOwned != null && message.hasOwnProperty("womenOwned")) + object.womenOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.womenOwned, options); + if (message.veteranOwned != null && message.hasOwnProperty("veteranOwned")) + object.veteranOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.veteranOwned, options); + if (message.latinoOwned != null && message.hasOwnProperty("latinoOwned")) + object.latinoOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.latinoOwned, options); + if (message.smallBusiness != null && message.hasOwnProperty("smallBusiness")) + object.smallBusiness = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.smallBusiness, options); + return object; + }; + + /** + * Converts this BusinessIdentity to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @instance + * @returns {Object.} JSON object + */ + BusinessIdentity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BusinessIdentity + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BusinessIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.BusinessIdentity"; + }; + + BusinessIdentity.IdentityAttribute = (function() { + + /** + * Properties of an IdentityAttribute. + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @interface IIdentityAttribute + * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration|null} [identityDeclaration] IdentityAttribute identityDeclaration + */ + + /** + * Constructs a new IdentityAttribute. + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity + * @classdesc Represents an IdentityAttribute. + * @implements IIdentityAttribute + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute=} [properties] Properties to set + */ + function IdentityAttribute(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]]; + } + + /** + * IdentityAttribute identityDeclaration. + * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration} identityDeclaration + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @instance + */ + IdentityAttribute.prototype.identityDeclaration = 0; + + /** + * Creates a new IdentityAttribute instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @static + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute} IdentityAttribute instance + */ + IdentityAttribute.create = function create(properties) { + return new IdentityAttribute(properties); + }; + + /** + * Encodes the specified IdentityAttribute message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @static + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute} message IdentityAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityAttribute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identityDeclaration != null && Object.hasOwnProperty.call(message, "identityDeclaration")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.identityDeclaration); + return writer; + }; + + /** + * Encodes the specified IdentityAttribute message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @static + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute} message IdentityAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityAttribute message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @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.BusinessIdentity.IdentityAttribute} IdentityAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityAttribute.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.BusinessIdentity.IdentityAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.identityDeclaration = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute} IdentityAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityAttribute message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identityDeclaration != null && message.hasOwnProperty("identityDeclaration")) + switch (message.identityDeclaration) { + default: + return "identityDeclaration: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an IdentityAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute} IdentityAttribute + */ + IdentityAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute(); + switch (object.identityDeclaration) { + default: + if (typeof object.identityDeclaration === "number") { + message.identityDeclaration = object.identityDeclaration; + break; + } + break; + case "IDENTITY_DECLARATION_UNSPECIFIED": + case 0: + message.identityDeclaration = 0; + break; + case "SELF_IDENTIFIES_AS": + case 1: + message.identityDeclaration = 1; + break; + case "DOES_NOT_SELF_IDENTIFY_AS": + case 2: + message.identityDeclaration = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an IdentityAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @static + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute} message IdentityAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.identityDeclaration = options.enums === String ? "IDENTITY_DECLARATION_UNSPECIFIED" : 0; + if (message.identityDeclaration != null && message.hasOwnProperty("identityDeclaration")) + object.identityDeclaration = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration[message.identityDeclaration] === undefined ? message.identityDeclaration : $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration[message.identityDeclaration] : message.identityDeclaration; + return object; + }; + + /** + * Converts this IdentityAttribute to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @instance + * @returns {Object.} JSON object + */ + IdentityAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IdentityAttribute + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentityAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute"; + }; + + /** + * IdentityDeclaration enum. + * @name google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration + * @enum {number} + * @property {number} IDENTITY_DECLARATION_UNSPECIFIED=0 IDENTITY_DECLARATION_UNSPECIFIED value + * @property {number} SELF_IDENTIFIES_AS=1 SELF_IDENTIFIES_AS value + * @property {number} DOES_NOT_SELF_IDENTIFY_AS=2 DOES_NOT_SELF_IDENTIFY_AS value + */ + IdentityAttribute.IdentityDeclaration = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDENTITY_DECLARATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "SELF_IDENTIFIES_AS"] = 1; + values[valuesById[2] = "DOES_NOT_SELF_IDENTIFY_AS"] = 2; + return values; + })(); + + return IdentityAttribute; + })(); + + /** + * PromotionsConsent enum. + * @name google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent + * @enum {number} + * @property {number} PROMOTIONS_CONSENT_UNSPECIFIED=0 PROMOTIONS_CONSENT_UNSPECIFIED value + * @property {number} PROMOTIONS_CONSENT_GIVEN=1 PROMOTIONS_CONSENT_GIVEN value + * @property {number} PROMOTIONS_CONSENT_DENIED=2 PROMOTIONS_CONSENT_DENIED value + */ + BusinessIdentity.PromotionsConsent = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROMOTIONS_CONSENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROMOTIONS_CONSENT_GIVEN"] = 1; + values[valuesById[2] = "PROMOTIONS_CONSENT_DENIED"] = 2; + return values; + })(); + + return BusinessIdentity; + })(); + + v1beta.GetBusinessIdentityRequest = (function() { + + /** + * Properties of a GetBusinessIdentityRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetBusinessIdentityRequest + * @property {string|null} [name] GetBusinessIdentityRequest name + */ + + /** + * Constructs a new GetBusinessIdentityRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetBusinessIdentityRequest. + * @implements IGetBusinessIdentityRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest=} [properties] Properties to set + */ + function GetBusinessIdentityRequest(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]]; + } + + /** + * GetBusinessIdentityRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @instance + */ + GetBusinessIdentityRequest.prototype.name = ""; + + /** + * Creates a new GetBusinessIdentityRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest} GetBusinessIdentityRequest instance + */ + GetBusinessIdentityRequest.create = function create(properties) { + return new GetBusinessIdentityRequest(properties); + }; + + /** + * Encodes the specified GetBusinessIdentityRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest} message GetBusinessIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBusinessIdentityRequest.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 GetBusinessIdentityRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest} message GetBusinessIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBusinessIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBusinessIdentityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @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.GetBusinessIdentityRequest} GetBusinessIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBusinessIdentityRequest.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.GetBusinessIdentityRequest(); + 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 GetBusinessIdentityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest} GetBusinessIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBusinessIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBusinessIdentityRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBusinessIdentityRequest.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 GetBusinessIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest} GetBusinessIdentityRequest + */ + GetBusinessIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBusinessIdentityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest} message GetBusinessIdentityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBusinessIdentityRequest.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 GetBusinessIdentityRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @instance + * @returns {Object.} JSON object + */ + GetBusinessIdentityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBusinessIdentityRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBusinessIdentityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest"; + }; + + return GetBusinessIdentityRequest; + })(); + + v1beta.UpdateBusinessIdentityRequest = (function() { + + /** + * Properties of an UpdateBusinessIdentityRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUpdateBusinessIdentityRequest + * @property {google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null} [businessIdentity] UpdateBusinessIdentityRequest businessIdentity + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBusinessIdentityRequest updateMask + */ + + /** + * Constructs a new UpdateBusinessIdentityRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UpdateBusinessIdentityRequest. + * @implements IUpdateBusinessIdentityRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest=} [properties] Properties to set + */ + function UpdateBusinessIdentityRequest(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]]; + } + + /** + * UpdateBusinessIdentityRequest businessIdentity. + * @member {google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null|undefined} businessIdentity + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @instance + */ + UpdateBusinessIdentityRequest.prototype.businessIdentity = null; + + /** + * UpdateBusinessIdentityRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @instance + */ + UpdateBusinessIdentityRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBusinessIdentityRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest} UpdateBusinessIdentityRequest instance + */ + UpdateBusinessIdentityRequest.create = function create(properties) { + return new UpdateBusinessIdentityRequest(properties); + }; + + /** + * Encodes the specified UpdateBusinessIdentityRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest} message UpdateBusinessIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBusinessIdentityRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.businessIdentity != null && Object.hasOwnProperty.call(message, "businessIdentity")) + $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.encode(message.businessIdentity, 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 UpdateBusinessIdentityRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest} message UpdateBusinessIdentityRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBusinessIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBusinessIdentityRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @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.UpdateBusinessIdentityRequest} UpdateBusinessIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBusinessIdentityRequest.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.UpdateBusinessIdentityRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.businessIdentity = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.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 UpdateBusinessIdentityRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest} UpdateBusinessIdentityRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBusinessIdentityRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBusinessIdentityRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBusinessIdentityRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.businessIdentity != null && message.hasOwnProperty("businessIdentity")) { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify(message.businessIdentity); + if (error) + return "businessIdentity." + 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 UpdateBusinessIdentityRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest} UpdateBusinessIdentityRequest + */ + UpdateBusinessIdentityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest(); + if (object.businessIdentity != null) { + if (typeof object.businessIdentity !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.businessIdentity: object expected"); + message.businessIdentity = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.fromObject(object.businessIdentity); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBusinessIdentityRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest} message UpdateBusinessIdentityRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBusinessIdentityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.businessIdentity = null; + object.updateMask = null; + } + if (message.businessIdentity != null && message.hasOwnProperty("businessIdentity")) + object.businessIdentity = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.toObject(message.businessIdentity, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBusinessIdentityRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBusinessIdentityRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBusinessIdentityRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBusinessIdentityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest"; + }; + + return UpdateBusinessIdentityRequest; + })(); + + v1beta.BusinessInfoService = (function() { + + /** + * Constructs a new BusinessInfoService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a BusinessInfoService + * @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 BusinessInfoService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BusinessInfoService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BusinessInfoService; + + /** + * Creates new BusinessInfoService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService + * @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 {BusinessInfoService} RPC service. Useful where requests and/or responses are streamed. + */ + BusinessInfoService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessInfoService|getBusinessInfo}. + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService + * @typedef GetBusinessInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.BusinessInfo} [response] BusinessInfo + */ + + /** + * Calls GetBusinessInfo. + * @function getBusinessInfo + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest} request GetBusinessInfoRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.BusinessInfoService.GetBusinessInfoCallback} callback Node-style callback called with the error, if any, and BusinessInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BusinessInfoService.prototype.getBusinessInfo = function getBusinessInfo(request, callback) { + return this.rpcCall(getBusinessInfo, $root.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest, $root.google.shopping.merchant.accounts.v1beta.BusinessInfo, request, callback); + }, "name", { value: "GetBusinessInfo" }); + + /** + * Calls GetBusinessInfo. + * @function getBusinessInfo + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest} request GetBusinessInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessInfoService|updateBusinessInfo}. + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService + * @typedef UpdateBusinessInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.BusinessInfo} [response] BusinessInfo + */ + + /** + * Calls UpdateBusinessInfo. + * @function updateBusinessInfo + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest} request UpdateBusinessInfoRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.BusinessInfoService.UpdateBusinessInfoCallback} callback Node-style callback called with the error, if any, and BusinessInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BusinessInfoService.prototype.updateBusinessInfo = function updateBusinessInfo(request, callback) { + return this.rpcCall(updateBusinessInfo, $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest, $root.google.shopping.merchant.accounts.v1beta.BusinessInfo, request, callback); + }, "name", { value: "UpdateBusinessInfo" }); + + /** + * Calls UpdateBusinessInfo. + * @function updateBusinessInfo + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest} request UpdateBusinessInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BusinessInfoService; + })(); + + v1beta.BusinessInfo = (function() { + + /** + * Properties of a BusinessInfo. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IBusinessInfo + * @property {string|null} [name] BusinessInfo name + * @property {google.type.IPostalAddress|null} [address] BusinessInfo address + * @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 + */ + + /** + * Constructs a new BusinessInfo. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a BusinessInfo. + * @implements IBusinessInfo + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IBusinessInfo=} [properties] Properties to set + */ + function BusinessInfo(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]]; + } + + /** + * BusinessInfo name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + BusinessInfo.prototype.name = ""; + + /** + * BusinessInfo address. + * @member {google.type.IPostalAddress|null|undefined} address + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + BusinessInfo.prototype.address = null; + + /** + * BusinessInfo phone. + * @member {google.type.IPhoneNumber|null|undefined} phone + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + BusinessInfo.prototype.phone = null; + + /** + * BusinessInfo phoneVerificationState. + * @member {google.shopping.merchant.accounts.v1beta.PhoneVerificationState|null|undefined} phoneVerificationState + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + BusinessInfo.prototype.phoneVerificationState = null; + + /** + * BusinessInfo customerService. + * @member {google.shopping.merchant.accounts.v1beta.ICustomerService|null|undefined} customerService + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + 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; + + /** + * BusinessInfo _address. + * @member {"address"|undefined} _address + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + Object.defineProperty(BusinessInfo.prototype, "_address", { + get: $util.oneOfGetter($oneOfFields = ["address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BusinessInfo _phone. + * @member {"phone"|undefined} _phone + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + Object.defineProperty(BusinessInfo.prototype, "_phone", { + get: $util.oneOfGetter($oneOfFields = ["phone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BusinessInfo _phoneVerificationState. + * @member {"phoneVerificationState"|undefined} _phoneVerificationState + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + Object.defineProperty(BusinessInfo.prototype, "_phoneVerificationState", { + get: $util.oneOfGetter($oneOfFields = ["phoneVerificationState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BusinessInfo _customerService. + * @member {"customerService"|undefined} _customerService + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + */ + Object.defineProperty(BusinessInfo.prototype, "_customerService", { + get: $util.oneOfGetter($oneOfFields = ["customerService"]), + 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 + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @static + * @param {google.shopping.merchant.accounts.v1beta.IBusinessInfo=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.BusinessInfo} BusinessInfo instance + */ + BusinessInfo.create = function create(properties) { + return new BusinessInfo(properties); + }; + + /** + * Encodes the specified BusinessInfo message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessInfo.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @static + * @param {google.shopping.merchant.accounts.v1beta.IBusinessInfo} message BusinessInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BusinessInfo.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.address != null && Object.hasOwnProperty.call(message, "address")) + $root.google.type.PostalAddress.encode(message.address, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.phone != null && Object.hasOwnProperty.call(message, "phone")) + $root.google.type.PhoneNumber.encode(message.phone, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.phoneVerificationState != null && Object.hasOwnProperty.call(message, "phoneVerificationState")) + 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; + }; + + /** + * Encodes the specified BusinessInfo message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @static + * @param {google.shopping.merchant.accounts.v1beta.IBusinessInfo} message BusinessInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BusinessInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BusinessInfo message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @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.BusinessInfo} BusinessInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BusinessInfo.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.BusinessInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.address = $root.google.type.PostalAddress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.phone = $root.google.type.PhoneNumber.decode(reader, reader.uint32()); + break; + } + case 4: { + message.phoneVerificationState = reader.int32(); + break; + } + case 5: { + 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; + } + } + return message; + }; + + /** + * Decodes a BusinessInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.BusinessInfo} BusinessInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BusinessInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BusinessInfo message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BusinessInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.address != null && message.hasOwnProperty("address")) { + properties._address = 1; + { + var error = $root.google.type.PostalAddress.verify(message.address); + if (error) + return "address." + error; + } + } + if (message.phone != null && message.hasOwnProperty("phone")) { + properties._phone = 1; + { + var error = $root.google.type.PhoneNumber.verify(message.phone); + if (error) + return "phone." + error; + } + } + if (message.phoneVerificationState != null && message.hasOwnProperty("phoneVerificationState")) { + properties._phoneVerificationState = 1; + switch (message.phoneVerificationState) { + default: + return "phoneVerificationState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.customerService != null && message.hasOwnProperty("customerService")) { + properties._customerService = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.CustomerService.verify(message.customerService); + if (error) + return "customerService." + error; + } + } + if (message.koreanBusinessRegistrationNumber != null && message.hasOwnProperty("koreanBusinessRegistrationNumber")) { + properties._koreanBusinessRegistrationNumber = 1; + if (!$util.isString(message.koreanBusinessRegistrationNumber)) + return "koreanBusinessRegistrationNumber: string expected"; + } + return null; + }; + + /** + * Creates a BusinessInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.BusinessInfo} BusinessInfo + */ + BusinessInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.BusinessInfo) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.BusinessInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.address != null) { + if (typeof object.address !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessInfo.address: object expected"); + message.address = $root.google.type.PostalAddress.fromObject(object.address); + } + if (object.phone != null) { + if (typeof object.phone !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessInfo.phone: object expected"); + message.phone = $root.google.type.PhoneNumber.fromObject(object.phone); + } + switch (object.phoneVerificationState) { + default: + if (typeof object.phoneVerificationState === "number") { + message.phoneVerificationState = object.phoneVerificationState; + break; + } + break; + case "PHONE_VERIFICATION_STATE_UNSPECIFIED": + case 0: + message.phoneVerificationState = 0; + break; + case "PHONE_VERIFICATION_STATE_VERIFIED": + case 1: + message.phoneVerificationState = 1; + break; + case "PHONE_VERIFICATION_STATE_UNVERIFIED": + case 2: + message.phoneVerificationState = 2; + break; + } + if (object.customerService != null) { + if (typeof object.customerService !== "object") + 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; + }; + + /** + * Creates a plain object from a BusinessInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @static + * @param {google.shopping.merchant.accounts.v1beta.BusinessInfo} message BusinessInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BusinessInfo.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; + if (message.address != null && message.hasOwnProperty("address")) { + object.address = $root.google.type.PostalAddress.toObject(message.address, options); + if (options.oneofs) + object._address = "address"; + } + if (message.phone != null && message.hasOwnProperty("phone")) { + object.phone = $root.google.type.PhoneNumber.toObject(message.phone, options); + if (options.oneofs) + object._phone = "phone"; + } + if (message.phoneVerificationState != null && message.hasOwnProperty("phoneVerificationState")) { + object.phoneVerificationState = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.PhoneVerificationState[message.phoneVerificationState] === undefined ? message.phoneVerificationState : $root.google.shopping.merchant.accounts.v1beta.PhoneVerificationState[message.phoneVerificationState] : message.phoneVerificationState; + if (options.oneofs) + object._phoneVerificationState = "phoneVerificationState"; + } + if (message.customerService != null && message.hasOwnProperty("customerService")) { + object.customerService = $root.google.shopping.merchant.accounts.v1beta.CustomerService.toObject(message.customerService, options); + 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; + }; + + /** + * Converts this BusinessInfo to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @instance + * @returns {Object.} JSON object + */ + BusinessInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BusinessInfo + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BusinessInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.BusinessInfo"; + }; + + return BusinessInfo; + })(); + + v1beta.GetBusinessInfoRequest = (function() { + + /** + * Properties of a GetBusinessInfoRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetBusinessInfoRequest + * @property {string|null} [name] GetBusinessInfoRequest name + */ + + /** + * Constructs a new GetBusinessInfoRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetBusinessInfoRequest. + * @implements IGetBusinessInfoRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest=} [properties] Properties to set + */ + function GetBusinessInfoRequest(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]]; + } + + /** + * GetBusinessInfoRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @instance + */ + GetBusinessInfoRequest.prototype.name = ""; + + /** + * Creates a new GetBusinessInfoRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest} GetBusinessInfoRequest instance + */ + GetBusinessInfoRequest.create = function create(properties) { + return new GetBusinessInfoRequest(properties); + }; + + /** + * Encodes the specified GetBusinessInfoRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest} message GetBusinessInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBusinessInfoRequest.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 GetBusinessInfoRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest} message GetBusinessInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBusinessInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBusinessInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @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.GetBusinessInfoRequest} GetBusinessInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBusinessInfoRequest.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.GetBusinessInfoRequest(); + 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 GetBusinessInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest} GetBusinessInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBusinessInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBusinessInfoRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBusinessInfoRequest.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 GetBusinessInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest} GetBusinessInfoRequest + */ + GetBusinessInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBusinessInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest} message GetBusinessInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBusinessInfoRequest.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 GetBusinessInfoRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetBusinessInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBusinessInfoRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBusinessInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest"; + }; + + return GetBusinessInfoRequest; + })(); + + v1beta.UpdateBusinessInfoRequest = (function() { + + /** + * Properties of an UpdateBusinessInfoRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUpdateBusinessInfoRequest + * @property {google.shopping.merchant.accounts.v1beta.IBusinessInfo|null} [businessInfo] UpdateBusinessInfoRequest businessInfo + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBusinessInfoRequest updateMask + */ + + /** + * Constructs a new UpdateBusinessInfoRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UpdateBusinessInfoRequest. + * @implements IUpdateBusinessInfoRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest=} [properties] Properties to set + */ + function UpdateBusinessInfoRequest(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]]; + } + + /** + * UpdateBusinessInfoRequest businessInfo. + * @member {google.shopping.merchant.accounts.v1beta.IBusinessInfo|null|undefined} businessInfo + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @instance + */ + UpdateBusinessInfoRequest.prototype.businessInfo = null; + + /** + * UpdateBusinessInfoRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @instance + */ + UpdateBusinessInfoRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBusinessInfoRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest} UpdateBusinessInfoRequest instance + */ + UpdateBusinessInfoRequest.create = function create(properties) { + return new UpdateBusinessInfoRequest(properties); + }; + + /** + * Encodes the specified UpdateBusinessInfoRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest} message UpdateBusinessInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBusinessInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.businessInfo != null && Object.hasOwnProperty.call(message, "businessInfo")) + $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.encode(message.businessInfo, 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 UpdateBusinessInfoRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest} message UpdateBusinessInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBusinessInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBusinessInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @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.UpdateBusinessInfoRequest} UpdateBusinessInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBusinessInfoRequest.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.UpdateBusinessInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.businessInfo = $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.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 UpdateBusinessInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest} UpdateBusinessInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBusinessInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBusinessInfoRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBusinessInfoRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.businessInfo != null && message.hasOwnProperty("businessInfo")) { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.verify(message.businessInfo); + if (error) + return "businessInfo." + 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 UpdateBusinessInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest} UpdateBusinessInfoRequest + */ + UpdateBusinessInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest(); + if (object.businessInfo != null) { + if (typeof object.businessInfo !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.businessInfo: object expected"); + message.businessInfo = $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.fromObject(object.businessInfo); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBusinessInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest} message UpdateBusinessInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBusinessInfoRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.businessInfo = null; + object.updateMask = null; + } + if (message.businessInfo != null && message.hasOwnProperty("businessInfo")) + object.businessInfo = $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.toObject(message.businessInfo, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBusinessInfoRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBusinessInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBusinessInfoRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBusinessInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest"; + }; + + return UpdateBusinessInfoRequest; + })(); + + v1beta.CustomerService = (function() { + + /** + * Properties of a CustomerService. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ICustomerService + * @property {string|null} [uri] CustomerService uri + * @property {string|null} [email] CustomerService email + * @property {google.type.IPhoneNumber|null} [phone] CustomerService phone + */ + + /** + * Constructs a new CustomerService. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a CustomerService. + * @implements ICustomerService + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ICustomerService=} [properties] Properties to set + */ + function CustomerService(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]]; + } + + /** + * CustomerService uri. + * @member {string|null|undefined} uri + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @instance + */ + CustomerService.prototype.uri = null; + + /** + * CustomerService email. + * @member {string|null|undefined} email + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @instance + */ + CustomerService.prototype.email = null; + + /** + * CustomerService phone. + * @member {google.type.IPhoneNumber|null|undefined} phone + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @instance + */ + CustomerService.prototype.phone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomerService _uri. + * @member {"uri"|undefined} _uri + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @instance + */ + Object.defineProperty(CustomerService.prototype, "_uri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomerService _email. + * @member {"email"|undefined} _email + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @instance + */ + Object.defineProperty(CustomerService.prototype, "_email", { + get: $util.oneOfGetter($oneOfFields = ["email"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomerService _phone. + * @member {"phone"|undefined} _phone + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @instance + */ + Object.defineProperty(CustomerService.prototype, "_phone", { + get: $util.oneOfGetter($oneOfFields = ["phone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomerService instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICustomerService=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.CustomerService} CustomerService instance + */ + CustomerService.create = function create(properties) { + return new CustomerService(properties); + }; + + /** + * Encodes the specified CustomerService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CustomerService.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICustomerService} message CustomerService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + if (message.phone != null && Object.hasOwnProperty.call(message, "phone")) + $root.google.type.PhoneNumber.encode(message.phone, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomerService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CustomerService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICustomerService} message CustomerService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerService message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @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.CustomerService} CustomerService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerService.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.CustomerService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.email = reader.string(); + break; + } + case 3: { + message.phone = $root.google.type.PhoneNumber.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.CustomerService} CustomerService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerService message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties._uri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.email != null && message.hasOwnProperty("email")) { + properties._email = 1; + if (!$util.isString(message.email)) + return "email: string expected"; + } + if (message.phone != null && message.hasOwnProperty("phone")) { + properties._phone = 1; + { + var error = $root.google.type.PhoneNumber.verify(message.phone); + if (error) + return "phone." + error; + } + } + return null; + }; + + /** + * Creates a CustomerService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.CustomerService} CustomerService + */ + CustomerService.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CustomerService) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.CustomerService(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.email != null) + message.email = String(object.email); + if (object.phone != null) { + if (typeof object.phone !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.CustomerService.phone: object expected"); + message.phone = $root.google.type.PhoneNumber.fromObject(object.phone); + } + return message; + }; + + /** + * Creates a plain object from a CustomerService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @static + * @param {google.shopping.merchant.accounts.v1beta.CustomerService} message CustomerService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object._uri = "uri"; + } + if (message.email != null && message.hasOwnProperty("email")) { + object.email = message.email; + if (options.oneofs) + object._email = "email"; + } + if (message.phone != null && message.hasOwnProperty("phone")) { + object.phone = $root.google.type.PhoneNumber.toObject(message.phone, options); + if (options.oneofs) + object._phone = "phone"; + } + return object; + }; + + /** + * Converts this CustomerService to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @instance + * @returns {Object.} JSON object + */ + CustomerService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerService + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.CustomerService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CustomerService"; + }; + + return CustomerService; + })(); + + /** + * PhoneVerificationState enum. + * @name google.shopping.merchant.accounts.v1beta.PhoneVerificationState + * @enum {number} + * @property {number} PHONE_VERIFICATION_STATE_UNSPECIFIED=0 PHONE_VERIFICATION_STATE_UNSPECIFIED value + * @property {number} PHONE_VERIFICATION_STATE_VERIFIED=1 PHONE_VERIFICATION_STATE_VERIFIED value + * @property {number} PHONE_VERIFICATION_STATE_UNVERIFIED=2 PHONE_VERIFICATION_STATE_UNVERIFIED value + */ + v1beta.PhoneVerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PHONE_VERIFICATION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PHONE_VERIFICATION_STATE_VERIFIED"] = 1; + values[valuesById[2] = "PHONE_VERIFICATION_STATE_UNVERIFIED"] = 2; + return values; + })(); + + v1beta.EmailPreferencesService = (function() { + + /** + * Constructs a new EmailPreferencesService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an EmailPreferencesService + * @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 EmailPreferencesService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EmailPreferencesService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EmailPreferencesService; + + /** + * Creates new EmailPreferencesService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService + * @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 {EmailPreferencesService} RPC service. Useful where requests and/or responses are streamed. + */ + EmailPreferencesService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.EmailPreferencesService|getEmailPreferences}. + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService + * @typedef GetEmailPreferencesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.EmailPreferences} [response] EmailPreferences + */ + + /** + * Calls GetEmailPreferences. + * @function getEmailPreferences + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest} request GetEmailPreferencesRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.EmailPreferencesService.GetEmailPreferencesCallback} callback Node-style callback called with the error, if any, and EmailPreferences + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EmailPreferencesService.prototype.getEmailPreferences = function getEmailPreferences(request, callback) { + return this.rpcCall(getEmailPreferences, $root.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest, $root.google.shopping.merchant.accounts.v1beta.EmailPreferences, request, callback); + }, "name", { value: "GetEmailPreferences" }); + + /** + * Calls GetEmailPreferences. + * @function getEmailPreferences + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest} request GetEmailPreferencesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.EmailPreferencesService|updateEmailPreferences}. + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService + * @typedef UpdateEmailPreferencesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.EmailPreferences} [response] EmailPreferences + */ + + /** + * Calls UpdateEmailPreferences. + * @function updateEmailPreferences + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest} request UpdateEmailPreferencesRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.EmailPreferencesService.UpdateEmailPreferencesCallback} callback Node-style callback called with the error, if any, and EmailPreferences + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EmailPreferencesService.prototype.updateEmailPreferences = function updateEmailPreferences(request, callback) { + return this.rpcCall(updateEmailPreferences, $root.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest, $root.google.shopping.merchant.accounts.v1beta.EmailPreferences, request, callback); + }, "name", { value: "UpdateEmailPreferences" }); + + /** + * Calls UpdateEmailPreferences. + * @function updateEmailPreferences + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest} request UpdateEmailPreferencesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EmailPreferencesService; + })(); + + v1beta.EmailPreferences = (function() { + + /** + * Properties of an EmailPreferences. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IEmailPreferences + * @property {string|null} [name] EmailPreferences name + * @property {google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState|null} [newsAndTips] EmailPreferences newsAndTips + */ + + /** + * Constructs a new EmailPreferences. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an EmailPreferences. + * @implements IEmailPreferences + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IEmailPreferences=} [properties] Properties to set + */ + function EmailPreferences(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]]; + } + + /** + * EmailPreferences name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @instance + */ + EmailPreferences.prototype.name = ""; + + /** + * EmailPreferences newsAndTips. + * @member {google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState} newsAndTips + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @instance + */ + EmailPreferences.prototype.newsAndTips = 0; + + /** + * Creates a new EmailPreferences instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @static + * @param {google.shopping.merchant.accounts.v1beta.IEmailPreferences=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.EmailPreferences} EmailPreferences instance + */ + EmailPreferences.create = function create(properties) { + return new EmailPreferences(properties); + }; + + /** + * Encodes the specified EmailPreferences message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EmailPreferences.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @static + * @param {google.shopping.merchant.accounts.v1beta.IEmailPreferences} message EmailPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailPreferences.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.newsAndTips != null && Object.hasOwnProperty.call(message, "newsAndTips")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newsAndTips); + return writer; + }; + + /** + * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EmailPreferences.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @static + * @param {google.shopping.merchant.accounts.v1beta.IEmailPreferences} message EmailPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailPreferences.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @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.EmailPreferences} EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailPreferences.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.EmailPreferences(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.newsAndTips = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.EmailPreferences} EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailPreferences.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmailPreferences message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmailPreferences.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.newsAndTips != null && message.hasOwnProperty("newsAndTips")) + switch (message.newsAndTips) { + default: + return "newsAndTips: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an EmailPreferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.EmailPreferences} EmailPreferences + */ + EmailPreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.EmailPreferences) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.EmailPreferences(); + if (object.name != null) + message.name = String(object.name); + switch (object.newsAndTips) { + default: + if (typeof object.newsAndTips === "number") { + message.newsAndTips = object.newsAndTips; + break; + } + break; + case "OPT_IN_STATE_UNSPECIFIED": + case 0: + message.newsAndTips = 0; + break; + case "OPTED_OUT": + case 1: + message.newsAndTips = 1; + break; + case "OPTED_IN": + case 2: + message.newsAndTips = 2; + break; + case "UNCONFIRMED": + case 3: + message.newsAndTips = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @static + * @param {google.shopping.merchant.accounts.v1beta.EmailPreferences} message EmailPreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmailPreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.newsAndTips = options.enums === String ? "OPT_IN_STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.newsAndTips != null && message.hasOwnProperty("newsAndTips")) + object.newsAndTips = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState[message.newsAndTips] === undefined ? message.newsAndTips : $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState[message.newsAndTips] : message.newsAndTips; + return object; + }; + + /** + * Converts this EmailPreferences to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @instance + * @returns {Object.} JSON object + */ + EmailPreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmailPreferences + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmailPreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.EmailPreferences"; + }; + + /** + * OptInState enum. + * @name google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState + * @enum {number} + * @property {number} OPT_IN_STATE_UNSPECIFIED=0 OPT_IN_STATE_UNSPECIFIED value + * @property {number} OPTED_OUT=1 OPTED_OUT value + * @property {number} OPTED_IN=2 OPTED_IN value + * @property {number} UNCONFIRMED=3 UNCONFIRMED value + */ + EmailPreferences.OptInState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPT_IN_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTED_OUT"] = 1; + values[valuesById[2] = "OPTED_IN"] = 2; + values[valuesById[3] = "UNCONFIRMED"] = 3; + return values; + })(); + + return EmailPreferences; + })(); + + v1beta.GetEmailPreferencesRequest = (function() { + + /** + * Properties of a GetEmailPreferencesRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetEmailPreferencesRequest + * @property {string|null} [name] GetEmailPreferencesRequest name + */ + + /** + * Constructs a new GetEmailPreferencesRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetEmailPreferencesRequest. + * @implements IGetEmailPreferencesRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest=} [properties] Properties to set + */ + function GetEmailPreferencesRequest(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]]; + } + + /** + * GetEmailPreferencesRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @instance + */ + GetEmailPreferencesRequest.prototype.name = ""; + + /** + * Creates a new GetEmailPreferencesRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest} GetEmailPreferencesRequest instance + */ + GetEmailPreferencesRequest.create = function create(properties) { + return new GetEmailPreferencesRequest(properties); + }; + + /** + * Encodes the specified GetEmailPreferencesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest} message GetEmailPreferencesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEmailPreferencesRequest.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 GetEmailPreferencesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest} message GetEmailPreferencesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEmailPreferencesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEmailPreferencesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @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.GetEmailPreferencesRequest} GetEmailPreferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEmailPreferencesRequest.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.GetEmailPreferencesRequest(); + 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 GetEmailPreferencesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest} GetEmailPreferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEmailPreferencesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEmailPreferencesRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEmailPreferencesRequest.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 GetEmailPreferencesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest} GetEmailPreferencesRequest + */ + GetEmailPreferencesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEmailPreferencesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest} message GetEmailPreferencesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEmailPreferencesRequest.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 GetEmailPreferencesRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @instance + * @returns {Object.} JSON object + */ + GetEmailPreferencesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEmailPreferencesRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEmailPreferencesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest"; + }; + + return GetEmailPreferencesRequest; + })(); + + v1beta.UpdateEmailPreferencesRequest = (function() { + + /** + * Properties of an UpdateEmailPreferencesRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUpdateEmailPreferencesRequest + * @property {google.shopping.merchant.accounts.v1beta.IEmailPreferences|null} [emailPreferences] UpdateEmailPreferencesRequest emailPreferences + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEmailPreferencesRequest updateMask + */ + + /** + * Constructs a new UpdateEmailPreferencesRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UpdateEmailPreferencesRequest. + * @implements IUpdateEmailPreferencesRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest=} [properties] Properties to set + */ + function UpdateEmailPreferencesRequest(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]]; + } + + /** + * UpdateEmailPreferencesRequest emailPreferences. + * @member {google.shopping.merchant.accounts.v1beta.IEmailPreferences|null|undefined} emailPreferences + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @instance + */ + UpdateEmailPreferencesRequest.prototype.emailPreferences = null; + + /** + * UpdateEmailPreferencesRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @instance + */ + UpdateEmailPreferencesRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEmailPreferencesRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest} UpdateEmailPreferencesRequest instance + */ + UpdateEmailPreferencesRequest.create = function create(properties) { + return new UpdateEmailPreferencesRequest(properties); + }; + + /** + * Encodes the specified UpdateEmailPreferencesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest} message UpdateEmailPreferencesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEmailPreferencesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.emailPreferences != null && Object.hasOwnProperty.call(message, "emailPreferences")) + $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.encode(message.emailPreferences, 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 UpdateEmailPreferencesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest} message UpdateEmailPreferencesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEmailPreferencesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEmailPreferencesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @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.UpdateEmailPreferencesRequest} UpdateEmailPreferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEmailPreferencesRequest.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.UpdateEmailPreferencesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.emailPreferences = $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.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 UpdateEmailPreferencesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest} UpdateEmailPreferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEmailPreferencesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEmailPreferencesRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEmailPreferencesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) { + var error = $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.verify(message.emailPreferences); + if (error) + return "emailPreferences." + 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 UpdateEmailPreferencesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest} UpdateEmailPreferencesRequest + */ + UpdateEmailPreferencesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest(); + if (object.emailPreferences != null) { + if (typeof object.emailPreferences !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.emailPreferences: object expected"); + message.emailPreferences = $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.fromObject(object.emailPreferences); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEmailPreferencesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest} message UpdateEmailPreferencesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEmailPreferencesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.emailPreferences = null; + object.updateMask = null; + } + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) + object.emailPreferences = $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.toObject(message.emailPreferences, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEmailPreferencesRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEmailPreferencesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEmailPreferencesRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEmailPreferencesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest"; + }; + + return UpdateEmailPreferencesRequest; + })(); + + v1beta.HomepageService = (function() { + + /** + * Constructs a new HomepageService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a HomepageService + * @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 HomepageService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (HomepageService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = HomepageService; + + /** + * Creates new HomepageService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @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 {HomepageService} RPC service. Useful where requests and/or responses are streamed. + */ + HomepageService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|getHomepage}. + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @typedef GetHomepageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Homepage} [response] Homepage + */ + + /** + * Calls GetHomepage. + * @function getHomepage + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest} request GetHomepageRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.HomepageService.GetHomepageCallback} callback Node-style callback called with the error, if any, and Homepage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HomepageService.prototype.getHomepage = function getHomepage(request, callback) { + return this.rpcCall(getHomepage, $root.google.shopping.merchant.accounts.v1beta.GetHomepageRequest, $root.google.shopping.merchant.accounts.v1beta.Homepage, request, callback); + }, "name", { value: "GetHomepage" }); + + /** + * Calls GetHomepage. + * @function getHomepage + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest} request GetHomepageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|updateHomepage}. + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @typedef UpdateHomepageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Homepage} [response] Homepage + */ + + /** + * Calls UpdateHomepage. + * @function updateHomepage + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest} request UpdateHomepageRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.HomepageService.UpdateHomepageCallback} callback Node-style callback called with the error, if any, and Homepage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HomepageService.prototype.updateHomepage = function updateHomepage(request, callback) { + return this.rpcCall(updateHomepage, $root.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest, $root.google.shopping.merchant.accounts.v1beta.Homepage, request, callback); + }, "name", { value: "UpdateHomepage" }); + + /** + * Calls UpdateHomepage. + * @function updateHomepage + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest} request UpdateHomepageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|claimHomepage}. + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @typedef ClaimHomepageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Homepage} [response] Homepage + */ + + /** + * Calls ClaimHomepage. + * @function claimHomepage + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest} request ClaimHomepageRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.HomepageService.ClaimHomepageCallback} callback Node-style callback called with the error, if any, and Homepage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HomepageService.prototype.claimHomepage = function claimHomepage(request, callback) { + return this.rpcCall(claimHomepage, $root.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest, $root.google.shopping.merchant.accounts.v1beta.Homepage, request, callback); + }, "name", { value: "ClaimHomepage" }); + + /** + * Calls ClaimHomepage. + * @function claimHomepage + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest} request ClaimHomepageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|unclaimHomepage}. + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @typedef UnclaimHomepageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Homepage} [response] Homepage + */ + + /** + * Calls UnclaimHomepage. + * @function unclaimHomepage + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest} request UnclaimHomepageRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.HomepageService.UnclaimHomepageCallback} callback Node-style callback called with the error, if any, and Homepage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HomepageService.prototype.unclaimHomepage = function unclaimHomepage(request, callback) { + return this.rpcCall(unclaimHomepage, $root.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest, $root.google.shopping.merchant.accounts.v1beta.Homepage, request, callback); + }, "name", { value: "UnclaimHomepage" }); + + /** + * Calls UnclaimHomepage. + * @function unclaimHomepage + * @memberof google.shopping.merchant.accounts.v1beta.HomepageService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest} request UnclaimHomepageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return HomepageService; + })(); + + v1beta.Homepage = (function() { + + /** + * Properties of a Homepage. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IHomepage + * @property {string|null} [name] Homepage name + * @property {string|null} [uri] Homepage uri + * @property {boolean|null} [claimed] Homepage claimed + */ + + /** + * Constructs a new Homepage. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Homepage. + * @implements IHomepage + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IHomepage=} [properties] Properties to set + */ + function Homepage(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]]; + } + + /** + * Homepage name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @instance + */ + Homepage.prototype.name = ""; + + /** + * Homepage uri. + * @member {string|null|undefined} uri + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @instance + */ + Homepage.prototype.uri = null; + + /** + * Homepage claimed. + * @member {boolean} claimed + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @instance + */ + Homepage.prototype.claimed = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Homepage _uri. + * @member {"uri"|undefined} _uri + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @instance + */ + Object.defineProperty(Homepage.prototype, "_uri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Homepage instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @static + * @param {google.shopping.merchant.accounts.v1beta.IHomepage=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Homepage} Homepage instance + */ + Homepage.create = function create(properties) { + return new Homepage(properties); + }; + + /** + * Encodes the specified Homepage message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Homepage.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @static + * @param {google.shopping.merchant.accounts.v1beta.IHomepage} message Homepage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Homepage.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.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.claimed != null && Object.hasOwnProperty.call(message, "claimed")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.claimed); + return writer; + }; + + /** + * Encodes the specified Homepage message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Homepage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @static + * @param {google.shopping.merchant.accounts.v1beta.IHomepage} message Homepage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Homepage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Homepage message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @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.Homepage} Homepage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Homepage.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.Homepage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uri = reader.string(); + break; + } + case 3: { + message.claimed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Homepage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Homepage} Homepage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Homepage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Homepage message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Homepage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties._uri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.claimed != null && message.hasOwnProperty("claimed")) + if (typeof message.claimed !== "boolean") + return "claimed: boolean expected"; + return null; + }; + + /** + * Creates a Homepage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Homepage} Homepage + */ + Homepage.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Homepage) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Homepage(); + if (object.name != null) + message.name = String(object.name); + if (object.uri != null) + message.uri = String(object.uri); + if (object.claimed != null) + message.claimed = Boolean(object.claimed); + return message; + }; + + /** + * Creates a plain object from a Homepage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @static + * @param {google.shopping.merchant.accounts.v1beta.Homepage} message Homepage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Homepage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.claimed = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object._uri = "uri"; + } + if (message.claimed != null && message.hasOwnProperty("claimed")) + object.claimed = message.claimed; + return object; + }; + + /** + * Converts this Homepage to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @instance + * @returns {Object.} JSON object + */ + Homepage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Homepage + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Homepage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Homepage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Homepage"; + }; + + return Homepage; + })(); + + v1beta.GetHomepageRequest = (function() { + + /** + * Properties of a GetHomepageRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetHomepageRequest + * @property {string|null} [name] GetHomepageRequest name + */ + + /** + * Constructs a new GetHomepageRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetHomepageRequest. + * @implements IGetHomepageRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest=} [properties] Properties to set + */ + function GetHomepageRequest(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]]; + } + + /** + * GetHomepageRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @instance + */ + GetHomepageRequest.prototype.name = ""; + + /** + * Creates a new GetHomepageRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetHomepageRequest} GetHomepageRequest instance + */ + GetHomepageRequest.create = function create(properties) { + return new GetHomepageRequest(properties); + }; + + /** + * Encodes the specified GetHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetHomepageRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest} message GetHomepageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHomepageRequest.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 GetHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetHomepageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest} message GetHomepageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHomepageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetHomepageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @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.GetHomepageRequest} GetHomepageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHomepageRequest.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.GetHomepageRequest(); + 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 GetHomepageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetHomepageRequest} GetHomepageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHomepageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetHomepageRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetHomepageRequest.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 GetHomepageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetHomepageRequest} GetHomepageRequest + */ + GetHomepageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetHomepageRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetHomepageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetHomepageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetHomepageRequest} message GetHomepageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetHomepageRequest.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 GetHomepageRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @instance + * @returns {Object.} JSON object + */ + GetHomepageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetHomepageRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetHomepageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetHomepageRequest"; + }; + + return GetHomepageRequest; + })(); + + v1beta.UpdateHomepageRequest = (function() { + + /** + * Properties of an UpdateHomepageRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUpdateHomepageRequest + * @property {google.shopping.merchant.accounts.v1beta.IHomepage|null} [homepage] UpdateHomepageRequest homepage + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateHomepageRequest updateMask + */ + + /** + * Constructs a new UpdateHomepageRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UpdateHomepageRequest. + * @implements IUpdateHomepageRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest=} [properties] Properties to set + */ + function UpdateHomepageRequest(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]]; + } + + /** + * UpdateHomepageRequest homepage. + * @member {google.shopping.merchant.accounts.v1beta.IHomepage|null|undefined} homepage + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @instance + */ + UpdateHomepageRequest.prototype.homepage = null; + + /** + * UpdateHomepageRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @instance + */ + UpdateHomepageRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateHomepageRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest} UpdateHomepageRequest instance + */ + UpdateHomepageRequest.create = function create(properties) { + return new UpdateHomepageRequest(properties); + }; + + /** + * Encodes the specified UpdateHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest} message UpdateHomepageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateHomepageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.homepage != null && Object.hasOwnProperty.call(message, "homepage")) + $root.google.shopping.merchant.accounts.v1beta.Homepage.encode(message.homepage, 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 UpdateHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest} message UpdateHomepageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateHomepageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateHomepageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @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.UpdateHomepageRequest} UpdateHomepageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateHomepageRequest.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.UpdateHomepageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.homepage = $root.google.shopping.merchant.accounts.v1beta.Homepage.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 UpdateHomepageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest} UpdateHomepageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateHomepageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateHomepageRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateHomepageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.homepage != null && message.hasOwnProperty("homepage")) { + var error = $root.google.shopping.merchant.accounts.v1beta.Homepage.verify(message.homepage); + if (error) + return "homepage." + 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 UpdateHomepageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest} UpdateHomepageRequest + */ + UpdateHomepageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest(); + if (object.homepage != null) { + if (typeof object.homepage !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.homepage: object expected"); + message.homepage = $root.google.shopping.merchant.accounts.v1beta.Homepage.fromObject(object.homepage); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateHomepageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest} message UpdateHomepageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateHomepageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.homepage = null; + object.updateMask = null; + } + if (message.homepage != null && message.hasOwnProperty("homepage")) + object.homepage = $root.google.shopping.merchant.accounts.v1beta.Homepage.toObject(message.homepage, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateHomepageRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateHomepageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateHomepageRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateHomepageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest"; + }; + + return UpdateHomepageRequest; + })(); + + v1beta.ClaimHomepageRequest = (function() { + + /** + * Properties of a ClaimHomepageRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IClaimHomepageRequest + * @property {string|null} [name] ClaimHomepageRequest name + */ + + /** + * Constructs a new ClaimHomepageRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ClaimHomepageRequest. + * @implements IClaimHomepageRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest=} [properties] Properties to set + */ + function ClaimHomepageRequest(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]]; + } + + /** + * ClaimHomepageRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @instance + */ + ClaimHomepageRequest.prototype.name = ""; + + /** + * Creates a new ClaimHomepageRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest} ClaimHomepageRequest instance + */ + ClaimHomepageRequest.create = function create(properties) { + return new ClaimHomepageRequest(properties); + }; + + /** + * Encodes the specified ClaimHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest} message ClaimHomepageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClaimHomepageRequest.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 ClaimHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest} message ClaimHomepageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClaimHomepageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClaimHomepageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @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.ClaimHomepageRequest} ClaimHomepageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClaimHomepageRequest.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.ClaimHomepageRequest(); + 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 ClaimHomepageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest} ClaimHomepageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClaimHomepageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClaimHomepageRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClaimHomepageRequest.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 ClaimHomepageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest} ClaimHomepageRequest + */ + ClaimHomepageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ClaimHomepageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest} message ClaimHomepageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClaimHomepageRequest.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 ClaimHomepageRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @instance + * @returns {Object.} JSON object + */ + ClaimHomepageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClaimHomepageRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClaimHomepageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest"; + }; + + return ClaimHomepageRequest; + })(); + + v1beta.UnclaimHomepageRequest = (function() { + + /** + * Properties of an UnclaimHomepageRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUnclaimHomepageRequest + * @property {string|null} [name] UnclaimHomepageRequest name + */ + + /** + * Constructs a new UnclaimHomepageRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UnclaimHomepageRequest. + * @implements IUnclaimHomepageRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest=} [properties] Properties to set + */ + function UnclaimHomepageRequest(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]]; + } + + /** + * UnclaimHomepageRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @instance + */ + UnclaimHomepageRequest.prototype.name = ""; + + /** + * Creates a new UnclaimHomepageRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest} UnclaimHomepageRequest instance + */ + UnclaimHomepageRequest.create = function create(properties) { + return new UnclaimHomepageRequest(properties); + }; + + /** + * Encodes the specified UnclaimHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest} message UnclaimHomepageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnclaimHomepageRequest.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 UnclaimHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest} message UnclaimHomepageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnclaimHomepageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnclaimHomepageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @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.UnclaimHomepageRequest} UnclaimHomepageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnclaimHomepageRequest.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.UnclaimHomepageRequest(); + 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 an UnclaimHomepageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest} UnclaimHomepageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnclaimHomepageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnclaimHomepageRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnclaimHomepageRequest.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 an UnclaimHomepageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest} UnclaimHomepageRequest + */ + UnclaimHomepageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UnclaimHomepageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest} message UnclaimHomepageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnclaimHomepageRequest.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 UnclaimHomepageRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @instance + * @returns {Object.} JSON object + */ + UnclaimHomepageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnclaimHomepageRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnclaimHomepageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest"; + }; + + return UnclaimHomepageRequest; + })(); + + v1beta.OnlineReturnPolicyService = (function() { + + /** + * Constructs a new OnlineReturnPolicyService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an OnlineReturnPolicyService + * @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 OnlineReturnPolicyService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (OnlineReturnPolicyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = OnlineReturnPolicyService; + + /** + * Creates new OnlineReturnPolicyService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService + * @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 {OnlineReturnPolicyService} RPC service. Useful where requests and/or responses are streamed. + */ + OnlineReturnPolicyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService|getOnlineReturnPolicy}. + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService + * @typedef GetOnlineReturnPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} [response] OnlineReturnPolicy + */ + + /** + * Calls GetOnlineReturnPolicy. + * @function getOnlineReturnPolicy + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest} request GetOnlineReturnPolicyRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.GetOnlineReturnPolicyCallback} callback Node-style callback called with the error, if any, and OnlineReturnPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OnlineReturnPolicyService.prototype.getOnlineReturnPolicy = function getOnlineReturnPolicy(request, callback) { + return this.rpcCall(getOnlineReturnPolicy, $root.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest, $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy, request, callback); + }, "name", { value: "GetOnlineReturnPolicy" }); + + /** + * Calls GetOnlineReturnPolicy. + * @function getOnlineReturnPolicy + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest} request GetOnlineReturnPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService|listOnlineReturnPolicies}. + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService + * @typedef ListOnlineReturnPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} [response] ListOnlineReturnPoliciesResponse + */ + + /** + * Calls ListOnlineReturnPolicies. + * @function listOnlineReturnPolicies + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest} request ListOnlineReturnPoliciesRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.ListOnlineReturnPoliciesCallback} callback Node-style callback called with the error, if any, and ListOnlineReturnPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OnlineReturnPolicyService.prototype.listOnlineReturnPolicies = function listOnlineReturnPolicies(request, callback) { + return this.rpcCall(listOnlineReturnPolicies, $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest, $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse, request, callback); + }, "name", { value: "ListOnlineReturnPolicies" }); + + /** + * Calls ListOnlineReturnPolicies. + * @function listOnlineReturnPolicies + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest} request ListOnlineReturnPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return OnlineReturnPolicyService; + })(); + + v1beta.GetOnlineReturnPolicyRequest = (function() { + + /** + * Properties of a GetOnlineReturnPolicyRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetOnlineReturnPolicyRequest + * @property {string|null} [name] GetOnlineReturnPolicyRequest name + */ + + /** + * Constructs a new GetOnlineReturnPolicyRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetOnlineReturnPolicyRequest. + * @implements IGetOnlineReturnPolicyRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest=} [properties] Properties to set + */ + function GetOnlineReturnPolicyRequest(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]]; + } + + /** + * GetOnlineReturnPolicyRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @instance + */ + GetOnlineReturnPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetOnlineReturnPolicyRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest} GetOnlineReturnPolicyRequest instance + */ + GetOnlineReturnPolicyRequest.create = function create(properties) { + return new GetOnlineReturnPolicyRequest(properties); + }; + + /** + * Encodes the specified GetOnlineReturnPolicyRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest} message GetOnlineReturnPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOnlineReturnPolicyRequest.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 GetOnlineReturnPolicyRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest} message GetOnlineReturnPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOnlineReturnPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOnlineReturnPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @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.GetOnlineReturnPolicyRequest} GetOnlineReturnPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOnlineReturnPolicyRequest.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.GetOnlineReturnPolicyRequest(); + 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 GetOnlineReturnPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest} GetOnlineReturnPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOnlineReturnPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOnlineReturnPolicyRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOnlineReturnPolicyRequest.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 GetOnlineReturnPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest} GetOnlineReturnPolicyRequest + */ + GetOnlineReturnPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOnlineReturnPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest} message GetOnlineReturnPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOnlineReturnPolicyRequest.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 GetOnlineReturnPolicyRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetOnlineReturnPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOnlineReturnPolicyRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOnlineReturnPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest"; + }; + + return GetOnlineReturnPolicyRequest; + })(); + + v1beta.ListOnlineReturnPoliciesRequest = (function() { + + /** + * Properties of a ListOnlineReturnPoliciesRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListOnlineReturnPoliciesRequest + * @property {string|null} [parent] ListOnlineReturnPoliciesRequest parent + * @property {number|null} [pageSize] ListOnlineReturnPoliciesRequest pageSize + * @property {string|null} [pageToken] ListOnlineReturnPoliciesRequest pageToken + */ + + /** + * Constructs a new ListOnlineReturnPoliciesRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListOnlineReturnPoliciesRequest. + * @implements IListOnlineReturnPoliciesRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest=} [properties] Properties to set + */ + function ListOnlineReturnPoliciesRequest(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]]; + } + + /** + * ListOnlineReturnPoliciesRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @instance + */ + ListOnlineReturnPoliciesRequest.prototype.parent = ""; + + /** + * ListOnlineReturnPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @instance + */ + ListOnlineReturnPoliciesRequest.prototype.pageSize = 0; + + /** + * ListOnlineReturnPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @instance + */ + ListOnlineReturnPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOnlineReturnPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest} ListOnlineReturnPoliciesRequest instance + */ + ListOnlineReturnPoliciesRequest.create = function create(properties) { + return new ListOnlineReturnPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListOnlineReturnPoliciesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest} message ListOnlineReturnPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOnlineReturnPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListOnlineReturnPoliciesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest} message ListOnlineReturnPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOnlineReturnPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOnlineReturnPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @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.ListOnlineReturnPoliciesRequest} ListOnlineReturnPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOnlineReturnPoliciesRequest.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.ListOnlineReturnPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOnlineReturnPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest} ListOnlineReturnPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOnlineReturnPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOnlineReturnPoliciesRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOnlineReturnPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOnlineReturnPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest} ListOnlineReturnPoliciesRequest + */ + ListOnlineReturnPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOnlineReturnPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest} message ListOnlineReturnPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOnlineReturnPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListOnlineReturnPoliciesRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListOnlineReturnPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOnlineReturnPoliciesRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOnlineReturnPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest"; + }; + + return ListOnlineReturnPoliciesRequest; + })(); + + v1beta.ListOnlineReturnPoliciesResponse = (function() { + + /** + * Properties of a ListOnlineReturnPoliciesResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListOnlineReturnPoliciesResponse + * @property {Array.|null} [onlineReturnPolicies] ListOnlineReturnPoliciesResponse onlineReturnPolicies + * @property {string|null} [nextPageToken] ListOnlineReturnPoliciesResponse nextPageToken + */ + + /** + * Constructs a new ListOnlineReturnPoliciesResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListOnlineReturnPoliciesResponse. + * @implements IListOnlineReturnPoliciesResponse + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse=} [properties] Properties to set + */ + function ListOnlineReturnPoliciesResponse(properties) { + this.onlineReturnPolicies = []; + 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]]; + } + + /** + * ListOnlineReturnPoliciesResponse onlineReturnPolicies. + * @member {Array.} onlineReturnPolicies + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @instance + */ + ListOnlineReturnPoliciesResponse.prototype.onlineReturnPolicies = $util.emptyArray; + + /** + * ListOnlineReturnPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @instance + */ + ListOnlineReturnPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOnlineReturnPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} ListOnlineReturnPoliciesResponse instance + */ + ListOnlineReturnPoliciesResponse.create = function create(properties) { + return new ListOnlineReturnPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListOnlineReturnPoliciesResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse} message ListOnlineReturnPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOnlineReturnPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onlineReturnPolicies != null && message.onlineReturnPolicies.length) + for (var i = 0; i < message.onlineReturnPolicies.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.encode(message.onlineReturnPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOnlineReturnPoliciesResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse} message ListOnlineReturnPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOnlineReturnPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOnlineReturnPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @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.ListOnlineReturnPoliciesResponse} ListOnlineReturnPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOnlineReturnPoliciesResponse.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.ListOnlineReturnPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.onlineReturnPolicies && message.onlineReturnPolicies.length)) + message.onlineReturnPolicies = []; + message.onlineReturnPolicies.push($root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOnlineReturnPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} ListOnlineReturnPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOnlineReturnPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOnlineReturnPoliciesResponse message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOnlineReturnPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.onlineReturnPolicies != null && message.hasOwnProperty("onlineReturnPolicies")) { + if (!Array.isArray(message.onlineReturnPolicies)) + return "onlineReturnPolicies: array expected"; + for (var i = 0; i < message.onlineReturnPolicies.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify(message.onlineReturnPolicies[i]); + if (error) + return "onlineReturnPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOnlineReturnPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} ListOnlineReturnPoliciesResponse + */ + ListOnlineReturnPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse(); + if (object.onlineReturnPolicies) { + if (!Array.isArray(object.onlineReturnPolicies)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.onlineReturnPolicies: array expected"); + message.onlineReturnPolicies = []; + for (var i = 0; i < object.onlineReturnPolicies.length; ++i) { + if (typeof object.onlineReturnPolicies[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.onlineReturnPolicies: object expected"); + message.onlineReturnPolicies[i] = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.fromObject(object.onlineReturnPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOnlineReturnPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} message ListOnlineReturnPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOnlineReturnPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.onlineReturnPolicies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.onlineReturnPolicies && message.onlineReturnPolicies.length) { + object.onlineReturnPolicies = []; + for (var j = 0; j < message.onlineReturnPolicies.length; ++j) + object.onlineReturnPolicies[j] = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.toObject(message.onlineReturnPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOnlineReturnPoliciesResponse to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListOnlineReturnPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOnlineReturnPoliciesResponse + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOnlineReturnPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse"; + }; + + return ListOnlineReturnPoliciesResponse; + })(); + + v1beta.OnlineReturnPolicy = (function() { + + /** + * Properties of an OnlineReturnPolicy. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IOnlineReturnPolicy + * @property {string|null} [name] OnlineReturnPolicy name + * @property {string|null} [returnPolicyId] OnlineReturnPolicy returnPolicyId + * @property {string|null} [label] OnlineReturnPolicy label + * @property {Array.|null} [countries] OnlineReturnPolicy countries + * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy|null} [policy] OnlineReturnPolicy policy + * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee|null} [restockingFee] OnlineReturnPolicy restockingFee + * @property {Array.|null} [returnMethods] OnlineReturnPolicy returnMethods + * @property {Array.|null} [itemConditions] OnlineReturnPolicy itemConditions + * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee|null} [returnShippingFee] OnlineReturnPolicy returnShippingFee + * @property {string|null} [returnPolicyUri] OnlineReturnPolicy returnPolicyUri + * @property {boolean|null} [acceptDefectiveOnly] OnlineReturnPolicy acceptDefectiveOnly + * @property {number|null} [processRefundDays] OnlineReturnPolicy processRefundDays + * @property {boolean|null} [acceptExchange] OnlineReturnPolicy acceptExchange + */ + + /** + * Constructs a new OnlineReturnPolicy. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an OnlineReturnPolicy. + * @implements IOnlineReturnPolicy + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy=} [properties] Properties to set + */ + function OnlineReturnPolicy(properties) { + this.countries = []; + this.returnMethods = []; + this.itemConditions = []; + 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]]; + } + + /** + * OnlineReturnPolicy name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.name = ""; + + /** + * OnlineReturnPolicy returnPolicyId. + * @member {string} returnPolicyId + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.returnPolicyId = ""; + + /** + * OnlineReturnPolicy label. + * @member {string} label + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.label = ""; + + /** + * OnlineReturnPolicy countries. + * @member {Array.} countries + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.countries = $util.emptyArray; + + /** + * OnlineReturnPolicy policy. + * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy|null|undefined} policy + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.policy = null; + + /** + * OnlineReturnPolicy restockingFee. + * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee|null|undefined} restockingFee + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.restockingFee = null; + + /** + * OnlineReturnPolicy returnMethods. + * @member {Array.} returnMethods + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.returnMethods = $util.emptyArray; + + /** + * OnlineReturnPolicy itemConditions. + * @member {Array.} itemConditions + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.itemConditions = $util.emptyArray; + + /** + * OnlineReturnPolicy returnShippingFee. + * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee|null|undefined} returnShippingFee + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.returnShippingFee = null; + + /** + * OnlineReturnPolicy returnPolicyUri. + * @member {string} returnPolicyUri + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.returnPolicyUri = ""; + + /** + * OnlineReturnPolicy acceptDefectiveOnly. + * @member {boolean|null|undefined} acceptDefectiveOnly + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.acceptDefectiveOnly = null; + + /** + * OnlineReturnPolicy processRefundDays. + * @member {number|null|undefined} processRefundDays + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.processRefundDays = null; + + /** + * OnlineReturnPolicy acceptExchange. + * @member {boolean|null|undefined} acceptExchange + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + OnlineReturnPolicy.prototype.acceptExchange = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OnlineReturnPolicy _acceptDefectiveOnly. + * @member {"acceptDefectiveOnly"|undefined} _acceptDefectiveOnly + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + Object.defineProperty(OnlineReturnPolicy.prototype, "_acceptDefectiveOnly", { + get: $util.oneOfGetter($oneOfFields = ["acceptDefectiveOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OnlineReturnPolicy _processRefundDays. + * @member {"processRefundDays"|undefined} _processRefundDays + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + Object.defineProperty(OnlineReturnPolicy.prototype, "_processRefundDays", { + get: $util.oneOfGetter($oneOfFields = ["processRefundDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OnlineReturnPolicy _acceptExchange. + * @member {"acceptExchange"|undefined} _acceptExchange + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + */ + Object.defineProperty(OnlineReturnPolicy.prototype, "_acceptExchange", { + get: $util.oneOfGetter($oneOfFields = ["acceptExchange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OnlineReturnPolicy instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @static + * @param {google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} OnlineReturnPolicy instance + */ + OnlineReturnPolicy.create = function create(properties) { + return new OnlineReturnPolicy(properties); + }; + + /** + * Encodes the specified OnlineReturnPolicy message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @static + * @param {google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy} message OnlineReturnPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnlineReturnPolicy.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.returnPolicyId != null && Object.hasOwnProperty.call(message, "returnPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.returnPolicyId); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.label); + if (message.countries != null && message.countries.length) + for (var i = 0; i < message.countries.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.countries[i]); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.encode(message.policy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.restockingFee != null && Object.hasOwnProperty.call(message, "restockingFee")) + $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.encode(message.restockingFee, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.returnMethods != null && message.returnMethods.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.returnMethods.length; ++i) + writer.int32(message.returnMethods[i]); + writer.ldelim(); + } + if (message.itemConditions != null && message.itemConditions.length) { + writer.uint32(/* id 8, wireType 2 =*/66).fork(); + for (var i = 0; i < message.itemConditions.length; ++i) + writer.int32(message.itemConditions[i]); + writer.ldelim(); + } + if (message.returnShippingFee != null && Object.hasOwnProperty.call(message, "returnShippingFee")) + $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.encode(message.returnShippingFee, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.returnPolicyUri != null && Object.hasOwnProperty.call(message, "returnPolicyUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.returnPolicyUri); + if (message.acceptDefectiveOnly != null && Object.hasOwnProperty.call(message, "acceptDefectiveOnly")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.acceptDefectiveOnly); + if (message.processRefundDays != null && Object.hasOwnProperty.call(message, "processRefundDays")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.processRefundDays); + if (message.acceptExchange != null && Object.hasOwnProperty.call(message, "acceptExchange")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.acceptExchange); + return writer; + }; + + /** + * Encodes the specified OnlineReturnPolicy message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @static + * @param {google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy} message OnlineReturnPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnlineReturnPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnlineReturnPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @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.OnlineReturnPolicy} OnlineReturnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnlineReturnPolicy.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.OnlineReturnPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.returnPolicyId = reader.string(); + break; + } + case 3: { + message.label = reader.string(); + break; + } + case 4: { + if (!(message.countries && message.countries.length)) + message.countries = []; + message.countries.push(reader.string()); + break; + } + case 5: { + message.policy = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.decode(reader, reader.uint32()); + break; + } + case 6: { + message.restockingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.returnMethods && message.returnMethods.length)) + message.returnMethods = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.returnMethods.push(reader.int32()); + } else + message.returnMethods.push(reader.int32()); + break; + } + case 8: { + if (!(message.itemConditions && message.itemConditions.length)) + message.itemConditions = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.itemConditions.push(reader.int32()); + } else + message.itemConditions.push(reader.int32()); + break; + } + case 9: { + message.returnShippingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.decode(reader, reader.uint32()); + break; + } + case 10: { + message.returnPolicyUri = reader.string(); + break; + } + case 11: { + message.acceptDefectiveOnly = reader.bool(); + break; + } + case 12: { + message.processRefundDays = reader.int32(); + break; + } + case 13: { + message.acceptExchange = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OnlineReturnPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} OnlineReturnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnlineReturnPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnlineReturnPolicy message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnlineReturnPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.returnPolicyId != null && message.hasOwnProperty("returnPolicyId")) + if (!$util.isString(message.returnPolicyId)) + return "returnPolicyId: string expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.countries != null && message.hasOwnProperty("countries")) { + if (!Array.isArray(message.countries)) + return "countries: array expected"; + for (var i = 0; i < message.countries.length; ++i) + if (!$util.isString(message.countries[i])) + return "countries: string[] expected"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.restockingFee != null && message.hasOwnProperty("restockingFee")) { + var error = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify(message.restockingFee); + if (error) + return "restockingFee." + error; + } + if (message.returnMethods != null && message.hasOwnProperty("returnMethods")) { + if (!Array.isArray(message.returnMethods)) + return "returnMethods: array expected"; + for (var i = 0; i < message.returnMethods.length; ++i) + switch (message.returnMethods[i]) { + default: + return "returnMethods: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.itemConditions != null && message.hasOwnProperty("itemConditions")) { + if (!Array.isArray(message.itemConditions)) + return "itemConditions: array expected"; + for (var i = 0; i < message.itemConditions.length; ++i) + switch (message.itemConditions[i]) { + default: + return "itemConditions: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.returnShippingFee != null && message.hasOwnProperty("returnShippingFee")) { + var error = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify(message.returnShippingFee); + if (error) + return "returnShippingFee." + error; + } + if (message.returnPolicyUri != null && message.hasOwnProperty("returnPolicyUri")) + if (!$util.isString(message.returnPolicyUri)) + return "returnPolicyUri: string expected"; + if (message.acceptDefectiveOnly != null && message.hasOwnProperty("acceptDefectiveOnly")) { + properties._acceptDefectiveOnly = 1; + if (typeof message.acceptDefectiveOnly !== "boolean") + return "acceptDefectiveOnly: boolean expected"; + } + if (message.processRefundDays != null && message.hasOwnProperty("processRefundDays")) { + properties._processRefundDays = 1; + if (!$util.isInteger(message.processRefundDays)) + return "processRefundDays: integer expected"; + } + if (message.acceptExchange != null && message.hasOwnProperty("acceptExchange")) { + properties._acceptExchange = 1; + if (typeof message.acceptExchange !== "boolean") + return "acceptExchange: boolean expected"; + } + return null; + }; + + /** + * Creates an OnlineReturnPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} OnlineReturnPolicy + */ + OnlineReturnPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.returnPolicyId != null) + message.returnPolicyId = String(object.returnPolicyId); + if (object.label != null) + message.label = String(object.label); + if (object.countries) { + if (!Array.isArray(object.countries)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.countries: array expected"); + message.countries = []; + for (var i = 0; i < object.countries.length; ++i) + message.countries[i] = String(object.countries[i]); + } + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.policy: object expected"); + message.policy = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.fromObject(object.policy); + } + if (object.restockingFee != null) { + if (typeof object.restockingFee !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.restockingFee: object expected"); + message.restockingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.fromObject(object.restockingFee); + } + if (object.returnMethods) { + if (!Array.isArray(object.returnMethods)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.returnMethods: array expected"); + message.returnMethods = []; + for (var i = 0; i < object.returnMethods.length; ++i) + switch (object.returnMethods[i]) { + default: + if (typeof object.returnMethods[i] === "number") { + message.returnMethods[i] = object.returnMethods[i]; + break; + } + case "RETURN_METHOD_UNSPECIFIED": + case 0: + message.returnMethods[i] = 0; + break; + case "BY_MAIL": + case 1: + message.returnMethods[i] = 1; + break; + case "IN_STORE": + case 2: + message.returnMethods[i] = 2; + break; + case "AT_A_KIOSK": + case 3: + message.returnMethods[i] = 3; + break; + } + } + if (object.itemConditions) { + if (!Array.isArray(object.itemConditions)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.itemConditions: array expected"); + message.itemConditions = []; + for (var i = 0; i < object.itemConditions.length; ++i) + switch (object.itemConditions[i]) { + default: + if (typeof object.itemConditions[i] === "number") { + message.itemConditions[i] = object.itemConditions[i]; + break; + } + case "ITEM_CONDITION_UNSPECIFIED": + case 0: + message.itemConditions[i] = 0; + break; + case "NEW": + case 1: + message.itemConditions[i] = 1; + break; + case "USED": + case 2: + message.itemConditions[i] = 2; + break; + } + } + if (object.returnShippingFee != null) { + if (typeof object.returnShippingFee !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.returnShippingFee: object expected"); + message.returnShippingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.fromObject(object.returnShippingFee); + } + if (object.returnPolicyUri != null) + message.returnPolicyUri = String(object.returnPolicyUri); + if (object.acceptDefectiveOnly != null) + message.acceptDefectiveOnly = Boolean(object.acceptDefectiveOnly); + if (object.processRefundDays != null) + message.processRefundDays = object.processRefundDays | 0; + if (object.acceptExchange != null) + message.acceptExchange = Boolean(object.acceptExchange); + return message; + }; + + /** + * Creates a plain object from an OnlineReturnPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} message OnlineReturnPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnlineReturnPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.countries = []; + object.returnMethods = []; + object.itemConditions = []; + } + if (options.defaults) { + object.name = ""; + object.returnPolicyId = ""; + object.label = ""; + object.policy = null; + object.restockingFee = null; + object.returnShippingFee = null; + object.returnPolicyUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.returnPolicyId != null && message.hasOwnProperty("returnPolicyId")) + object.returnPolicyId = message.returnPolicyId; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.countries && message.countries.length) { + object.countries = []; + for (var j = 0; j < message.countries.length; ++j) + object.countries[j] = message.countries[j]; + } + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.toObject(message.policy, options); + if (message.restockingFee != null && message.hasOwnProperty("restockingFee")) + object.restockingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.toObject(message.restockingFee, options); + if (message.returnMethods && message.returnMethods.length) { + object.returnMethods = []; + for (var j = 0; j < message.returnMethods.length; ++j) + object.returnMethods[j] = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod[message.returnMethods[j]] === undefined ? message.returnMethods[j] : $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod[message.returnMethods[j]] : message.returnMethods[j]; + } + if (message.itemConditions && message.itemConditions.length) { + object.itemConditions = []; + for (var j = 0; j < message.itemConditions.length; ++j) + object.itemConditions[j] = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition[message.itemConditions[j]] === undefined ? message.itemConditions[j] : $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition[message.itemConditions[j]] : message.itemConditions[j]; + } + if (message.returnShippingFee != null && message.hasOwnProperty("returnShippingFee")) + object.returnShippingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.toObject(message.returnShippingFee, options); + if (message.returnPolicyUri != null && message.hasOwnProperty("returnPolicyUri")) + object.returnPolicyUri = message.returnPolicyUri; + if (message.acceptDefectiveOnly != null && message.hasOwnProperty("acceptDefectiveOnly")) { + object.acceptDefectiveOnly = message.acceptDefectiveOnly; + if (options.oneofs) + object._acceptDefectiveOnly = "acceptDefectiveOnly"; + } + if (message.processRefundDays != null && message.hasOwnProperty("processRefundDays")) { + object.processRefundDays = message.processRefundDays; + if (options.oneofs) + object._processRefundDays = "processRefundDays"; + } + if (message.acceptExchange != null && message.hasOwnProperty("acceptExchange")) { + object.acceptExchange = message.acceptExchange; + if (options.oneofs) + object._acceptExchange = "acceptExchange"; + } + return object; + }; + + /** + * Converts this OnlineReturnPolicy to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @instance + * @returns {Object.} JSON object + */ + OnlineReturnPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnlineReturnPolicy + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnlineReturnPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy"; + }; + + OnlineReturnPolicy.ReturnShippingFee = (function() { + + /** + * Properties of a ReturnShippingFee. + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @interface IReturnShippingFee + * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type|null} [type] ReturnShippingFee type + * @property {google.shopping.type.IPrice|null} [fixedFee] ReturnShippingFee fixedFee + */ + + /** + * Constructs a new ReturnShippingFee. + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @classdesc Represents a ReturnShippingFee. + * @implements IReturnShippingFee + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee=} [properties] Properties to set + */ + function ReturnShippingFee(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]]; + } + + /** + * ReturnShippingFee type. + * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type} type + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @instance + */ + ReturnShippingFee.prototype.type = 0; + + /** + * ReturnShippingFee fixedFee. + * @member {google.shopping.type.IPrice|null|undefined} fixedFee + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @instance + */ + ReturnShippingFee.prototype.fixedFee = null; + + /** + * Creates a new ReturnShippingFee instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee} ReturnShippingFee instance + */ + ReturnShippingFee.create = function create(properties) { + return new ReturnShippingFee(properties); + }; + + /** + * Encodes the specified ReturnShippingFee message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee} message ReturnShippingFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReturnShippingFee.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.fixedFee != null && Object.hasOwnProperty.call(message, "fixedFee")) + $root.google.shopping.type.Price.encode(message.fixedFee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReturnShippingFee message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee} message ReturnShippingFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReturnShippingFee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReturnShippingFee message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @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.OnlineReturnPolicy.ReturnShippingFee} ReturnShippingFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReturnShippingFee.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.OnlineReturnPolicy.ReturnShippingFee(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.fixedFee = $root.google.shopping.type.Price.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReturnShippingFee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee} ReturnShippingFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReturnShippingFee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReturnShippingFee message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReturnShippingFee.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.fixedFee != null && message.hasOwnProperty("fixedFee")) { + var error = $root.google.shopping.type.Price.verify(message.fixedFee); + if (error) + return "fixedFee." + error; + } + return null; + }; + + /** + * Creates a ReturnShippingFee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee} ReturnShippingFee + */ + ReturnShippingFee.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "FIXED": + case 1: + message.type = 1; + break; + case "CUSTOMER_PAYING_ACTUAL_FEE": + case 2: + message.type = 2; + break; + } + if (object.fixedFee != null) { + if (typeof object.fixedFee !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.fixedFee: object expected"); + message.fixedFee = $root.google.shopping.type.Price.fromObject(object.fixedFee); + } + return message; + }; + + /** + * Creates a plain object from a ReturnShippingFee message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee} message ReturnShippingFee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReturnShippingFee.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.fixedFee = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type[message.type] === undefined ? message.type : $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type[message.type] : message.type; + if (message.fixedFee != null && message.hasOwnProperty("fixedFee")) + object.fixedFee = $root.google.shopping.type.Price.toObject(message.fixedFee, options); + return object; + }; + + /** + * Converts this ReturnShippingFee to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @instance + * @returns {Object.} JSON object + */ + ReturnShippingFee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReturnShippingFee + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReturnShippingFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee"; + }; + + /** + * Type enum. + * @name google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} FIXED=1 FIXED value + * @property {number} CUSTOMER_PAYING_ACTUAL_FEE=2 CUSTOMER_PAYING_ACTUAL_FEE value + */ + ReturnShippingFee.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIXED"] = 1; + values[valuesById[2] = "CUSTOMER_PAYING_ACTUAL_FEE"] = 2; + return values; + })(); + + return ReturnShippingFee; + })(); + + OnlineReturnPolicy.RestockingFee = (function() { + + /** + * Properties of a RestockingFee. + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @interface IRestockingFee + * @property {google.shopping.type.IPrice|null} [fixedFee] RestockingFee fixedFee + * @property {number|null} [microPercent] RestockingFee microPercent + */ + + /** + * Constructs a new RestockingFee. + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @classdesc Represents a RestockingFee. + * @implements IRestockingFee + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee=} [properties] Properties to set + */ + function RestockingFee(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]]; + } + + /** + * RestockingFee fixedFee. + * @member {google.shopping.type.IPrice|null|undefined} fixedFee + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @instance + */ + RestockingFee.prototype.fixedFee = null; + + /** + * RestockingFee microPercent. + * @member {number|null|undefined} microPercent + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @instance + */ + RestockingFee.prototype.microPercent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestockingFee type. + * @member {"fixedFee"|"microPercent"|undefined} type + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @instance + */ + Object.defineProperty(RestockingFee.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "microPercent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestockingFee instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee} RestockingFee instance + */ + RestockingFee.create = function create(properties) { + return new RestockingFee(properties); + }; + + /** + * Encodes the specified RestockingFee message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee} message RestockingFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestockingFee.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixedFee != null && Object.hasOwnProperty.call(message, "fixedFee")) + $root.google.shopping.type.Price.encode(message.fixedFee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.microPercent != null && Object.hasOwnProperty.call(message, "microPercent")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.microPercent); + return writer; + }; + + /** + * Encodes the specified RestockingFee message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee} message RestockingFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestockingFee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestockingFee message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @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.OnlineReturnPolicy.RestockingFee} RestockingFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestockingFee.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.OnlineReturnPolicy.RestockingFee(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fixedFee = $root.google.shopping.type.Price.decode(reader, reader.uint32()); + break; + } + case 2: { + message.microPercent = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestockingFee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee} RestockingFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestockingFee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestockingFee message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestockingFee.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixedFee != null && message.hasOwnProperty("fixedFee")) { + properties.type = 1; + { + var error = $root.google.shopping.type.Price.verify(message.fixedFee); + if (error) + return "fixedFee." + error; + } + } + if (message.microPercent != null && message.hasOwnProperty("microPercent")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + if (!$util.isInteger(message.microPercent)) + return "microPercent: integer expected"; + } + return null; + }; + + /** + * Creates a RestockingFee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee} RestockingFee + */ + RestockingFee.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee(); + if (object.fixedFee != null) { + if (typeof object.fixedFee !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.fixedFee: object expected"); + message.fixedFee = $root.google.shopping.type.Price.fromObject(object.fixedFee); + } + if (object.microPercent != null) + message.microPercent = object.microPercent | 0; + return message; + }; + + /** + * Creates a plain object from a RestockingFee message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee} message RestockingFee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestockingFee.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fixedFee != null && message.hasOwnProperty("fixedFee")) { + object.fixedFee = $root.google.shopping.type.Price.toObject(message.fixedFee, options); + if (options.oneofs) + object.type = "fixedFee"; + } + if (message.microPercent != null && message.hasOwnProperty("microPercent")) { + object.microPercent = message.microPercent; + if (options.oneofs) + object.type = "microPercent"; + } + return object; + }; + + /** + * Converts this RestockingFee to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @instance + * @returns {Object.} JSON object + */ + RestockingFee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestockingFee + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestockingFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee"; + }; + + return RestockingFee; + })(); + + OnlineReturnPolicy.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @interface IPolicy + * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type|null} [type] Policy type + * @property {number|Long|null} [days] Policy days + */ + + /** + * Constructs a new Policy. + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy=} [properties] Properties to set + */ + function Policy(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]]; + } + + /** + * Policy type. + * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type} type + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @instance + */ + Policy.prototype.type = 0; + + /** + * Policy days. + * @member {number|Long} days + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @instance + */ + Policy.prototype.days = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.days != null && Object.hasOwnProperty.call(message, "days")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.days); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @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.OnlineReturnPolicy.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.OnlineReturnPolicy.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.days = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.days != null && message.hasOwnProperty("days")) + if (!$util.isInteger(message.days) && !(message.days && $util.isInteger(message.days.low) && $util.isInteger(message.days.high))) + return "days: integer|Long expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "NUMBER_OF_DAYS_AFTER_DELIVERY": + case 1: + message.type = 1; + break; + case "NO_RETURNS": + case 2: + message.type = 2; + break; + case "LIFETIME_RETURNS": + case 3: + message.type = 3; + break; + } + if (object.days != null) + if ($util.Long) + (message.days = $util.Long.fromValue(object.days)).unsigned = false; + else if (typeof object.days === "string") + message.days = parseInt(object.days, 10); + else if (typeof object.days === "number") + message.days = object.days; + else if (typeof object.days === "object") + message.days = new $util.LongBits(object.days.low >>> 0, object.days.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @static + * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.days = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.days = options.longs === String ? "0" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type[message.type] === undefined ? message.type : $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type[message.type] : message.type; + if (message.days != null && message.hasOwnProperty("days")) + if (typeof message.days === "number") + object.days = options.longs === String ? String(message.days) : message.days; + else + object.days = options.longs === String ? $util.Long.prototype.toString.call(message.days) : options.longs === Number ? new $util.LongBits(message.days.low >>> 0, message.days.high >>> 0).toNumber() : message.days; + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy"; + }; + + /** + * Type enum. + * @name google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} NUMBER_OF_DAYS_AFTER_DELIVERY=1 NUMBER_OF_DAYS_AFTER_DELIVERY value + * @property {number} NO_RETURNS=2 NO_RETURNS value + * @property {number} LIFETIME_RETURNS=3 LIFETIME_RETURNS value + */ + Policy.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NUMBER_OF_DAYS_AFTER_DELIVERY"] = 1; + values[valuesById[2] = "NO_RETURNS"] = 2; + values[valuesById[3] = "LIFETIME_RETURNS"] = 3; + return values; + })(); + + return Policy; + })(); + + /** + * ReturnMethod enum. + * @name google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod + * @enum {number} + * @property {number} RETURN_METHOD_UNSPECIFIED=0 RETURN_METHOD_UNSPECIFIED value + * @property {number} BY_MAIL=1 BY_MAIL value + * @property {number} IN_STORE=2 IN_STORE value + * @property {number} AT_A_KIOSK=3 AT_A_KIOSK value + */ + OnlineReturnPolicy.ReturnMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETURN_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "BY_MAIL"] = 1; + values[valuesById[2] = "IN_STORE"] = 2; + values[valuesById[3] = "AT_A_KIOSK"] = 3; + return values; + })(); + + /** + * ItemCondition enum. + * @name google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition + * @enum {number} + * @property {number} ITEM_CONDITION_UNSPECIFIED=0 ITEM_CONDITION_UNSPECIFIED value + * @property {number} NEW=1 NEW value + * @property {number} USED=2 USED value + */ + OnlineReturnPolicy.ItemCondition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ITEM_CONDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEW"] = 1; + values[valuesById[2] = "USED"] = 2; + return values; + })(); + + return OnlineReturnPolicy; + })(); + + v1beta.ProgramsService = (function() { + + /** + * Constructs a new ProgramsService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ProgramsService + * @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 ProgramsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ProgramsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProgramsService; + + /** + * Creates new ProgramsService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @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 {ProgramsService} RPC service. Useful where requests and/or responses are streamed. + */ + ProgramsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|getProgram}. + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @typedef GetProgramCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Program} [response] Program + */ + + /** + * Calls GetProgram. + * @function getProgram + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest} request GetProgramRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.ProgramsService.GetProgramCallback} callback Node-style callback called with the error, if any, and Program + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProgramsService.prototype.getProgram = function getProgram(request, callback) { + return this.rpcCall(getProgram, $root.google.shopping.merchant.accounts.v1beta.GetProgramRequest, $root.google.shopping.merchant.accounts.v1beta.Program, request, callback); + }, "name", { value: "GetProgram" }); + + /** + * Calls GetProgram. + * @function getProgram + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest} request GetProgramRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|listPrograms}. + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @typedef ListProgramsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} [response] ListProgramsResponse + */ + + /** + * Calls ListPrograms. + * @function listPrograms + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest} request ListProgramsRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.ProgramsService.ListProgramsCallback} callback Node-style callback called with the error, if any, and ListProgramsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProgramsService.prototype.listPrograms = function listPrograms(request, callback) { + return this.rpcCall(listPrograms, $root.google.shopping.merchant.accounts.v1beta.ListProgramsRequest, $root.google.shopping.merchant.accounts.v1beta.ListProgramsResponse, request, callback); + }, "name", { value: "ListPrograms" }); + + /** + * Calls ListPrograms. + * @function listPrograms + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest} request ListProgramsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|enableProgram}. + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @typedef EnableProgramCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Program} [response] Program + */ + + /** + * Calls EnableProgram. + * @function enableProgram + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest} request EnableProgramRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.ProgramsService.EnableProgramCallback} callback Node-style callback called with the error, if any, and Program + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProgramsService.prototype.enableProgram = function enableProgram(request, callback) { + return this.rpcCall(enableProgram, $root.google.shopping.merchant.accounts.v1beta.EnableProgramRequest, $root.google.shopping.merchant.accounts.v1beta.Program, request, callback); + }, "name", { value: "EnableProgram" }); + + /** + * Calls EnableProgram. + * @function enableProgram + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest} request EnableProgramRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|disableProgram}. + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @typedef DisableProgramCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Program} [response] Program + */ + + /** + * Calls DisableProgram. + * @function disableProgram + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest} request DisableProgramRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.ProgramsService.DisableProgramCallback} callback Node-style callback called with the error, if any, and Program + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProgramsService.prototype.disableProgram = function disableProgram(request, callback) { + return this.rpcCall(disableProgram, $root.google.shopping.merchant.accounts.v1beta.DisableProgramRequest, $root.google.shopping.merchant.accounts.v1beta.Program, request, callback); + }, "name", { value: "DisableProgram" }); + + /** + * Calls DisableProgram. + * @function disableProgram + * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest} request DisableProgramRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ProgramsService; + })(); + + v1beta.Program = (function() { + + /** + * Properties of a Program. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IProgram + * @property {string|null} [name] Program name + * @property {string|null} [documentationUri] Program documentationUri + * @property {google.shopping.merchant.accounts.v1beta.Program.State|null} [state] Program state + * @property {Array.|null} [activeRegionCodes] Program activeRegionCodes + * @property {Array.|null} [unmetRequirements] Program unmetRequirements + */ + + /** + * Constructs a new Program. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Program. + * @implements IProgram + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IProgram=} [properties] Properties to set + */ + function Program(properties) { + this.activeRegionCodes = []; + this.unmetRequirements = []; + 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]]; + } + + /** + * Program name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @instance + */ + Program.prototype.name = ""; + + /** + * Program documentationUri. + * @member {string} documentationUri + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @instance + */ + Program.prototype.documentationUri = ""; + + /** + * Program state. + * @member {google.shopping.merchant.accounts.v1beta.Program.State} state + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @instance + */ + Program.prototype.state = 0; + + /** + * Program activeRegionCodes. + * @member {Array.} activeRegionCodes + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @instance + */ + Program.prototype.activeRegionCodes = $util.emptyArray; + + /** + * Program unmetRequirements. + * @member {Array.} unmetRequirements + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @instance + */ + Program.prototype.unmetRequirements = $util.emptyArray; + + /** + * Creates a new Program instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @static + * @param {google.shopping.merchant.accounts.v1beta.IProgram=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Program} Program instance + */ + Program.create = function create(properties) { + return new Program(properties); + }; + + /** + * Encodes the specified Program message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @static + * @param {google.shopping.merchant.accounts.v1beta.IProgram} message Program message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Program.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.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentationUri); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.activeRegionCodes != null && message.activeRegionCodes.length) + for (var i = 0; i < message.activeRegionCodes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.activeRegionCodes[i]); + if (message.unmetRequirements != null && message.unmetRequirements.length) + for (var i = 0; i < message.unmetRequirements.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Program.Requirement.encode(message.unmetRequirements[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Program message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @static + * @param {google.shopping.merchant.accounts.v1beta.IProgram} message Program message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Program.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Program message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @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.Program} Program + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Program.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.Program(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.documentationUri = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + if (!(message.activeRegionCodes && message.activeRegionCodes.length)) + message.activeRegionCodes = []; + message.activeRegionCodes.push(reader.string()); + break; + } + case 5: { + if (!(message.unmetRequirements && message.unmetRequirements.length)) + message.unmetRequirements = []; + message.unmetRequirements.push($root.google.shopping.merchant.accounts.v1beta.Program.Requirement.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Program message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Program} Program + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Program.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Program message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Program.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.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.activeRegionCodes != null && message.hasOwnProperty("activeRegionCodes")) { + if (!Array.isArray(message.activeRegionCodes)) + return "activeRegionCodes: array expected"; + for (var i = 0; i < message.activeRegionCodes.length; ++i) + if (!$util.isString(message.activeRegionCodes[i])) + return "activeRegionCodes: string[] expected"; + } + if (message.unmetRequirements != null && message.hasOwnProperty("unmetRequirements")) { + if (!Array.isArray(message.unmetRequirements)) + return "unmetRequirements: array expected"; + for (var i = 0; i < message.unmetRequirements.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Program.Requirement.verify(message.unmetRequirements[i]); + if (error) + return "unmetRequirements." + error; + } + } + return null; + }; + + /** + * Creates a Program message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Program} Program + */ + Program.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Program) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Program(); + if (object.name != null) + message.name = String(object.name); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NOT_ELIGIBLE": + case 1: + message.state = 1; + break; + case "ELIGIBLE": + case 2: + message.state = 2; + break; + case "ENABLED": + case 3: + message.state = 3; + break; + } + if (object.activeRegionCodes) { + if (!Array.isArray(object.activeRegionCodes)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Program.activeRegionCodes: array expected"); + message.activeRegionCodes = []; + for (var i = 0; i < object.activeRegionCodes.length; ++i) + message.activeRegionCodes[i] = String(object.activeRegionCodes[i]); + } + if (object.unmetRequirements) { + if (!Array.isArray(object.unmetRequirements)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Program.unmetRequirements: array expected"); + message.unmetRequirements = []; + for (var i = 0; i < object.unmetRequirements.length; ++i) { + if (typeof object.unmetRequirements[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Program.unmetRequirements: object expected"); + message.unmetRequirements[i] = $root.google.shopping.merchant.accounts.v1beta.Program.Requirement.fromObject(object.unmetRequirements[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Program message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @static + * @param {google.shopping.merchant.accounts.v1beta.Program} message Program + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Program.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.activeRegionCodes = []; + object.unmetRequirements = []; + } + if (options.defaults) { + object.name = ""; + object.documentationUri = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.Program.State[message.state] === undefined ? message.state : $root.google.shopping.merchant.accounts.v1beta.Program.State[message.state] : message.state; + if (message.activeRegionCodes && message.activeRegionCodes.length) { + object.activeRegionCodes = []; + for (var j = 0; j < message.activeRegionCodes.length; ++j) + object.activeRegionCodes[j] = message.activeRegionCodes[j]; + } + if (message.unmetRequirements && message.unmetRequirements.length) { + object.unmetRequirements = []; + for (var j = 0; j < message.unmetRequirements.length; ++j) + object.unmetRequirements[j] = $root.google.shopping.merchant.accounts.v1beta.Program.Requirement.toObject(message.unmetRequirements[j], options); + } + return object; + }; + + /** + * Converts this Program to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @instance + * @returns {Object.} JSON object + */ + Program.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Program + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Program.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Program"; + }; + + Program.Requirement = (function() { + + /** + * Properties of a Requirement. + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @interface IRequirement + * @property {string|null} [title] Requirement title + * @property {string|null} [documentationUri] Requirement documentationUri + * @property {Array.|null} [affectedRegionCodes] Requirement affectedRegionCodes + */ + + /** + * Constructs a new Requirement. + * @memberof google.shopping.merchant.accounts.v1beta.Program + * @classdesc Represents a Requirement. + * @implements IRequirement + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.Program.IRequirement=} [properties] Properties to set + */ + function Requirement(properties) { + this.affectedRegionCodes = []; + 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]]; + } + + /** + * Requirement title. + * @member {string} title + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @instance + */ + Requirement.prototype.title = ""; + + /** + * Requirement documentationUri. + * @member {string} documentationUri + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @instance + */ + Requirement.prototype.documentationUri = ""; + + /** + * Requirement affectedRegionCodes. + * @member {Array.} affectedRegionCodes + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @instance + */ + Requirement.prototype.affectedRegionCodes = $util.emptyArray; + + /** + * Creates a new Requirement instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @static + * @param {google.shopping.merchant.accounts.v1beta.Program.IRequirement=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Program.Requirement} Requirement instance + */ + Requirement.create = function create(properties) { + return new Requirement(properties); + }; + + /** + * Encodes the specified Requirement message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.Requirement.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @static + * @param {google.shopping.merchant.accounts.v1beta.Program.IRequirement} message Requirement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Requirement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentationUri); + if (message.affectedRegionCodes != null && message.affectedRegionCodes.length) + for (var i = 0; i < message.affectedRegionCodes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.affectedRegionCodes[i]); + return writer; + }; + + /** + * Encodes the specified Requirement message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.Requirement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @static + * @param {google.shopping.merchant.accounts.v1beta.Program.IRequirement} message Requirement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Requirement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Requirement message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @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.Program.Requirement} Requirement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Requirement.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.Program.Requirement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.documentationUri = reader.string(); + break; + } + case 3: { + if (!(message.affectedRegionCodes && message.affectedRegionCodes.length)) + message.affectedRegionCodes = []; + message.affectedRegionCodes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Requirement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Program.Requirement} Requirement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Requirement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Requirement message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Requirement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.affectedRegionCodes != null && message.hasOwnProperty("affectedRegionCodes")) { + if (!Array.isArray(message.affectedRegionCodes)) + return "affectedRegionCodes: array expected"; + for (var i = 0; i < message.affectedRegionCodes.length; ++i) + if (!$util.isString(message.affectedRegionCodes[i])) + return "affectedRegionCodes: string[] expected"; + } + return null; + }; + + /** + * Creates a Requirement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Program.Requirement} Requirement + */ + Requirement.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Program.Requirement) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Program.Requirement(); + if (object.title != null) + message.title = String(object.title); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.affectedRegionCodes) { + if (!Array.isArray(object.affectedRegionCodes)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Program.Requirement.affectedRegionCodes: array expected"); + message.affectedRegionCodes = []; + for (var i = 0; i < object.affectedRegionCodes.length; ++i) + message.affectedRegionCodes[i] = String(object.affectedRegionCodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a Requirement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @static + * @param {google.shopping.merchant.accounts.v1beta.Program.Requirement} message Requirement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Requirement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.affectedRegionCodes = []; + if (options.defaults) { + object.title = ""; + object.documentationUri = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.affectedRegionCodes && message.affectedRegionCodes.length) { + object.affectedRegionCodes = []; + for (var j = 0; j < message.affectedRegionCodes.length; ++j) + object.affectedRegionCodes[j] = message.affectedRegionCodes[j]; + } + return object; + }; + + /** + * Converts this Requirement to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @instance + * @returns {Object.} JSON object + */ + Requirement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Requirement + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Requirement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Program.Requirement"; + }; + + return Requirement; + })(); + + /** + * State enum. + * @name google.shopping.merchant.accounts.v1beta.Program.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} NOT_ELIGIBLE=1 NOT_ELIGIBLE value + * @property {number} ELIGIBLE=2 ELIGIBLE value + * @property {number} ENABLED=3 ENABLED value + */ + Program.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOT_ELIGIBLE"] = 1; + values[valuesById[2] = "ELIGIBLE"] = 2; + values[valuesById[3] = "ENABLED"] = 3; + return values; + })(); + + return Program; + })(); + + v1beta.GetProgramRequest = (function() { + + /** + * Properties of a GetProgramRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetProgramRequest + * @property {string|null} [name] GetProgramRequest name + */ + + /** + * Constructs a new GetProgramRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetProgramRequest. + * @implements IGetProgramRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest=} [properties] Properties to set + */ + function GetProgramRequest(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]]; + } + + /** + * GetProgramRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @instance + */ + GetProgramRequest.prototype.name = ""; + + /** + * Creates a new GetProgramRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetProgramRequest} GetProgramRequest instance + */ + GetProgramRequest.create = function create(properties) { + return new GetProgramRequest(properties); + }; + + /** + * Encodes the specified GetProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetProgramRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest} message GetProgramRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProgramRequest.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 GetProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetProgramRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest} message GetProgramRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProgramRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProgramRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @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.GetProgramRequest} GetProgramRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProgramRequest.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.GetProgramRequest(); + 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 GetProgramRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetProgramRequest} GetProgramRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProgramRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProgramRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProgramRequest.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 GetProgramRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetProgramRequest} GetProgramRequest + */ + GetProgramRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetProgramRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetProgramRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProgramRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetProgramRequest} message GetProgramRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProgramRequest.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 GetProgramRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @instance + * @returns {Object.} JSON object + */ + GetProgramRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProgramRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProgramRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetProgramRequest"; + }; + + return GetProgramRequest; + })(); + + v1beta.ListProgramsRequest = (function() { + + /** + * Properties of a ListProgramsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListProgramsRequest + * @property {string|null} [parent] ListProgramsRequest parent + * @property {number|null} [pageSize] ListProgramsRequest pageSize + * @property {string|null} [pageToken] ListProgramsRequest pageToken + */ + + /** + * Constructs a new ListProgramsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListProgramsRequest. + * @implements IListProgramsRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest=} [properties] Properties to set + */ + function ListProgramsRequest(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]]; + } + + /** + * ListProgramsRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @instance + */ + ListProgramsRequest.prototype.parent = ""; + + /** + * ListProgramsRequest pageSize. + * @member {number} pageSize + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @instance + */ + ListProgramsRequest.prototype.pageSize = 0; + + /** + * ListProgramsRequest pageToken. + * @member {string} pageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @instance + */ + ListProgramsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProgramsRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsRequest} ListProgramsRequest instance + */ + ListProgramsRequest.create = function create(properties) { + return new ListProgramsRequest(properties); + }; + + /** + * Encodes the specified ListProgramsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest} message ListProgramsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProgramsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListProgramsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest} message ListProgramsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProgramsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProgramsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @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.ListProgramsRequest} ListProgramsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProgramsRequest.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.ListProgramsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProgramsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsRequest} ListProgramsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProgramsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProgramsRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProgramsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListProgramsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsRequest} ListProgramsRequest + */ + ListProgramsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListProgramsRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListProgramsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListProgramsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListProgramsRequest} message ListProgramsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProgramsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListProgramsRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProgramsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProgramsRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProgramsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListProgramsRequest"; + }; + + return ListProgramsRequest; + })(); + + v1beta.ListProgramsResponse = (function() { + + /** + * Properties of a ListProgramsResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListProgramsResponse + * @property {Array.|null} [programs] ListProgramsResponse programs + * @property {string|null} [nextPageToken] ListProgramsResponse nextPageToken + */ + + /** + * Constructs a new ListProgramsResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListProgramsResponse. + * @implements IListProgramsResponse + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsResponse=} [properties] Properties to set + */ + function ListProgramsResponse(properties) { + this.programs = []; + 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]]; + } + + /** + * ListProgramsResponse programs. + * @member {Array.} programs + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @instance + */ + ListProgramsResponse.prototype.programs = $util.emptyArray; + + /** + * ListProgramsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @instance + */ + ListProgramsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProgramsResponse instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsResponse=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} ListProgramsResponse instance + */ + ListProgramsResponse.create = function create(properties) { + return new ListProgramsResponse(properties); + }; + + /** + * Encodes the specified ListProgramsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsResponse.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsResponse} message ListProgramsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProgramsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.programs != null && message.programs.length) + for (var i = 0; i < message.programs.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Program.encode(message.programs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListProgramsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListProgramsResponse} message ListProgramsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProgramsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProgramsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @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.ListProgramsResponse} ListProgramsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProgramsResponse.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.ListProgramsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.programs && message.programs.length)) + message.programs = []; + message.programs.push($root.google.shopping.merchant.accounts.v1beta.Program.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProgramsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} ListProgramsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProgramsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProgramsResponse message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProgramsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.programs != null && message.hasOwnProperty("programs")) { + if (!Array.isArray(message.programs)) + return "programs: array expected"; + for (var i = 0; i < message.programs.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Program.verify(message.programs[i]); + if (error) + return "programs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProgramsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} ListProgramsResponse + */ + ListProgramsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListProgramsResponse) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListProgramsResponse(); + if (object.programs) { + if (!Array.isArray(object.programs)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListProgramsResponse.programs: array expected"); + message.programs = []; + for (var i = 0; i < object.programs.length; ++i) { + if (typeof object.programs[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListProgramsResponse.programs: object expected"); + message.programs[i] = $root.google.shopping.merchant.accounts.v1beta.Program.fromObject(object.programs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProgramsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} message ListProgramsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProgramsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.programs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.programs && message.programs.length) { + object.programs = []; + for (var j = 0; j < message.programs.length; ++j) + object.programs[j] = $root.google.shopping.merchant.accounts.v1beta.Program.toObject(message.programs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProgramsResponse to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProgramsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProgramsResponse + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProgramsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListProgramsResponse"; + }; + + return ListProgramsResponse; + })(); + + v1beta.EnableProgramRequest = (function() { + + /** + * Properties of an EnableProgramRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IEnableProgramRequest + * @property {string|null} [name] EnableProgramRequest name + */ + + /** + * Constructs a new EnableProgramRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an EnableProgramRequest. + * @implements IEnableProgramRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest=} [properties] Properties to set + */ + function EnableProgramRequest(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]]; + } + + /** + * EnableProgramRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @instance + */ + EnableProgramRequest.prototype.name = ""; + + /** + * Creates a new EnableProgramRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.EnableProgramRequest} EnableProgramRequest instance + */ + EnableProgramRequest.create = function create(properties) { + return new EnableProgramRequest(properties); + }; + + /** + * Encodes the specified EnableProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EnableProgramRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest} message EnableProgramRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProgramRequest.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 EnableProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EnableProgramRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest} message EnableProgramRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProgramRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableProgramRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @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.EnableProgramRequest} EnableProgramRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProgramRequest.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.EnableProgramRequest(); + 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 an EnableProgramRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.EnableProgramRequest} EnableProgramRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProgramRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableProgramRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableProgramRequest.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 an EnableProgramRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.EnableProgramRequest} EnableProgramRequest + */ + EnableProgramRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.EnableProgramRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.EnableProgramRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an EnableProgramRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.EnableProgramRequest} message EnableProgramRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableProgramRequest.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 EnableProgramRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @instance + * @returns {Object.} JSON object + */ + EnableProgramRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableProgramRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableProgramRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.EnableProgramRequest"; + }; + + return EnableProgramRequest; + })(); + + v1beta.DisableProgramRequest = (function() { + + /** + * Properties of a DisableProgramRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IDisableProgramRequest + * @property {string|null} [name] DisableProgramRequest name + */ + + /** + * Constructs a new DisableProgramRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a DisableProgramRequest. + * @implements IDisableProgramRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest=} [properties] Properties to set + */ + function DisableProgramRequest(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]]; + } + + /** + * DisableProgramRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @instance + */ + DisableProgramRequest.prototype.name = ""; + + /** + * Creates a new DisableProgramRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.DisableProgramRequest} DisableProgramRequest instance + */ + DisableProgramRequest.create = function create(properties) { + return new DisableProgramRequest(properties); + }; + + /** + * Encodes the specified DisableProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DisableProgramRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest} message DisableProgramRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProgramRequest.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 DisableProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DisableProgramRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest} message DisableProgramRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProgramRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableProgramRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @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.DisableProgramRequest} DisableProgramRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProgramRequest.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.DisableProgramRequest(); + 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 DisableProgramRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.DisableProgramRequest} DisableProgramRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProgramRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableProgramRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableProgramRequest.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 DisableProgramRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.DisableProgramRequest} DisableProgramRequest + */ + DisableProgramRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DisableProgramRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.DisableProgramRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DisableProgramRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.DisableProgramRequest} message DisableProgramRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableProgramRequest.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 DisableProgramRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @instance + * @returns {Object.} JSON object + */ + DisableProgramRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableProgramRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableProgramRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DisableProgramRequest"; + }; + + return DisableProgramRequest; + })(); + + v1beta.RegionsService = (function() { + + /** + * Constructs a new RegionsService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a RegionsService + * @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 RegionsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionsService; + + /** + * Creates new RegionsService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @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 {RegionsService} RPC service. Useful where requests and/or responses are streamed. + */ + RegionsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|getRegion}. + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @typedef GetRegionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Region} [response] Region + */ + + /** + * Calls GetRegion. + * @function getRegion + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest} request GetRegionRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.RegionsService.GetRegionCallback} callback Node-style callback called with the error, if any, and Region + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionsService.prototype.getRegion = function getRegion(request, callback) { + return this.rpcCall(getRegion, $root.google.shopping.merchant.accounts.v1beta.GetRegionRequest, $root.google.shopping.merchant.accounts.v1beta.Region, request, callback); + }, "name", { value: "GetRegion" }); + + /** + * Calls GetRegion. + * @function getRegion + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest} request GetRegionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|createRegion}. + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @typedef CreateRegionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Region} [response] Region + */ + + /** + * Calls CreateRegion. + * @function createRegion + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest} request CreateRegionRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.RegionsService.CreateRegionCallback} callback Node-style callback called with the error, if any, and Region + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionsService.prototype.createRegion = function createRegion(request, callback) { + return this.rpcCall(createRegion, $root.google.shopping.merchant.accounts.v1beta.CreateRegionRequest, $root.google.shopping.merchant.accounts.v1beta.Region, request, callback); + }, "name", { value: "CreateRegion" }); + + /** + * Calls CreateRegion. + * @function createRegion + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest} request CreateRegionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|updateRegion}. + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @typedef UpdateRegionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.Region} [response] Region + */ + + /** + * Calls UpdateRegion. + * @function updateRegion + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest} request UpdateRegionRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.RegionsService.UpdateRegionCallback} callback Node-style callback called with the error, if any, and Region + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionsService.prototype.updateRegion = function updateRegion(request, callback) { + return this.rpcCall(updateRegion, $root.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest, $root.google.shopping.merchant.accounts.v1beta.Region, request, callback); + }, "name", { value: "UpdateRegion" }); + + /** + * Calls UpdateRegion. + * @function updateRegion + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest} request UpdateRegionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|deleteRegion}. + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @typedef DeleteRegionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteRegion. + * @function deleteRegion + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest} request DeleteRegionRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.RegionsService.DeleteRegionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionsService.prototype.deleteRegion = function deleteRegion(request, callback) { + return this.rpcCall(deleteRegion, $root.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteRegion" }); + + /** + * Calls DeleteRegion. + * @function deleteRegion + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest} request DeleteRegionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|listRegions}. + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @typedef ListRegionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} [response] ListRegionsResponse + */ + + /** + * Calls ListRegions. + * @function listRegions + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest} request ListRegionsRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.RegionsService.ListRegionsCallback} callback Node-style callback called with the error, if any, and ListRegionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionsService.prototype.listRegions = function listRegions(request, callback) { + return this.rpcCall(listRegions, $root.google.shopping.merchant.accounts.v1beta.ListRegionsRequest, $root.google.shopping.merchant.accounts.v1beta.ListRegionsResponse, request, callback); + }, "name", { value: "ListRegions" }); + + /** + * Calls ListRegions. + * @function listRegions + * @memberof google.shopping.merchant.accounts.v1beta.RegionsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest} request ListRegionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionsService; + })(); + + v1beta.GetRegionRequest = (function() { + + /** + * Properties of a GetRegionRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetRegionRequest + * @property {string|null} [name] GetRegionRequest name + */ + + /** + * Constructs a new GetRegionRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetRegionRequest. + * @implements IGetRegionRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest=} [properties] Properties to set + */ + function GetRegionRequest(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]]; + } + + /** + * GetRegionRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @instance + */ + GetRegionRequest.prototype.name = ""; + + /** + * Creates a new GetRegionRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetRegionRequest} GetRegionRequest instance + */ + GetRegionRequest.create = function create(properties) { + return new GetRegionRequest(properties); + }; + + /** + * Encodes the specified GetRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetRegionRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest} message GetRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionRequest.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 GetRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetRegionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest} message GetRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @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.GetRegionRequest} GetRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionRequest.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.GetRegionRequest(); + 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 GetRegionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetRegionRequest} GetRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionRequest.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 GetRegionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetRegionRequest} GetRegionRequest + */ + GetRegionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetRegionRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetRegionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRegionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetRegionRequest} message GetRegionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionRequest.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 GetRegionRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRegionRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRegionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetRegionRequest"; + }; + + return GetRegionRequest; + })(); + + v1beta.CreateRegionRequest = (function() { + + /** + * Properties of a CreateRegionRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ICreateRegionRequest + * @property {string|null} [parent] CreateRegionRequest parent + * @property {string|null} [regionId] CreateRegionRequest regionId + * @property {google.shopping.merchant.accounts.v1beta.IRegion|null} [region] CreateRegionRequest region + */ + + /** + * Constructs a new CreateRegionRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a CreateRegionRequest. + * @implements ICreateRegionRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest=} [properties] Properties to set + */ + function CreateRegionRequest(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]]; + } + + /** + * CreateRegionRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @instance + */ + CreateRegionRequest.prototype.parent = ""; + + /** + * CreateRegionRequest regionId. + * @member {string} regionId + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @instance + */ + CreateRegionRequest.prototype.regionId = ""; + + /** + * CreateRegionRequest region. + * @member {google.shopping.merchant.accounts.v1beta.IRegion|null|undefined} region + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @instance + */ + CreateRegionRequest.prototype.region = null; + + /** + * Creates a new CreateRegionRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.CreateRegionRequest} CreateRegionRequest instance + */ + CreateRegionRequest.create = function create(properties) { + return new CreateRegionRequest(properties); + }; + + /** + * Encodes the specified CreateRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateRegionRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest} message CreateRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRegionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.regionId != null && Object.hasOwnProperty.call(message, "regionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + $root.google.shopping.merchant.accounts.v1beta.Region.encode(message.region, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateRegionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest} message CreateRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRegionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRegionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @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.CreateRegionRequest} CreateRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRegionRequest.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.CreateRegionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.regionId = reader.string(); + break; + } + case 3: { + message.region = $root.google.shopping.merchant.accounts.v1beta.Region.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRegionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.CreateRegionRequest} CreateRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRegionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRegionRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRegionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.regionId != null && message.hasOwnProperty("regionId")) + if (!$util.isString(message.regionId)) + return "regionId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) { + var error = $root.google.shopping.merchant.accounts.v1beta.Region.verify(message.region); + if (error) + return "region." + error; + } + return null; + }; + + /** + * Creates a CreateRegionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.CreateRegionRequest} CreateRegionRequest + */ + CreateRegionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateRegionRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.CreateRegionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.regionId != null) + message.regionId = String(object.regionId); + if (object.region != null) { + if (typeof object.region !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateRegionRequest.region: object expected"); + message.region = $root.google.shopping.merchant.accounts.v1beta.Region.fromObject(object.region); + } + return message; + }; + + /** + * Creates a plain object from a CreateRegionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.CreateRegionRequest} message CreateRegionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRegionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.regionId = ""; + object.region = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.regionId != null && message.hasOwnProperty("regionId")) + object.regionId = message.regionId; + if (message.region != null && message.hasOwnProperty("region")) + object.region = $root.google.shopping.merchant.accounts.v1beta.Region.toObject(message.region, options); + return object; + }; + + /** + * Converts this CreateRegionRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRegionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRegionRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRegionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateRegionRequest"; + }; + + return CreateRegionRequest; + })(); + + v1beta.UpdateRegionRequest = (function() { + + /** + * Properties of an UpdateRegionRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IUpdateRegionRequest + * @property {google.shopping.merchant.accounts.v1beta.IRegion|null} [region] UpdateRegionRequest region + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRegionRequest updateMask + */ + + /** + * Constructs a new UpdateRegionRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an UpdateRegionRequest. + * @implements IUpdateRegionRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest=} [properties] Properties to set + */ + function UpdateRegionRequest(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]]; + } + + /** + * UpdateRegionRequest region. + * @member {google.shopping.merchant.accounts.v1beta.IRegion|null|undefined} region + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @instance + */ + UpdateRegionRequest.prototype.region = null; + + /** + * UpdateRegionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @instance + */ + UpdateRegionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateRegionRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.UpdateRegionRequest} UpdateRegionRequest instance + */ + UpdateRegionRequest.create = function create(properties) { + return new UpdateRegionRequest(properties); + }; + + /** + * Encodes the specified UpdateRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest} message UpdateRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + $root.google.shopping.merchant.accounts.v1beta.Region.encode(message.region, 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 UpdateRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest} message UpdateRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRegionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @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.UpdateRegionRequest} UpdateRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionRequest.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.UpdateRegionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.region = $root.google.shopping.merchant.accounts.v1beta.Region.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 UpdateRegionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.UpdateRegionRequest} UpdateRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRegionRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRegionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.region != null && message.hasOwnProperty("region")) { + var error = $root.google.shopping.merchant.accounts.v1beta.Region.verify(message.region); + if (error) + return "region." + 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 UpdateRegionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.UpdateRegionRequest} UpdateRegionRequest + */ + UpdateRegionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest(); + if (object.region != null) { + if (typeof object.region !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.region: object expected"); + message.region = $root.google.shopping.merchant.accounts.v1beta.Region.fromObject(object.region); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRegionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.UpdateRegionRequest} message UpdateRegionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRegionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = null; + object.updateMask = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = $root.google.shopping.merchant.accounts.v1beta.Region.toObject(message.region, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateRegionRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRegionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateRegionRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateRegionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateRegionRequest"; + }; + + return UpdateRegionRequest; + })(); + + v1beta.DeleteRegionRequest = (function() { + + /** + * Properties of a DeleteRegionRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IDeleteRegionRequest + * @property {string|null} [name] DeleteRegionRequest name + */ + + /** + * Constructs a new DeleteRegionRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a DeleteRegionRequest. + * @implements IDeleteRegionRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest=} [properties] Properties to set + */ + function DeleteRegionRequest(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]]; + } + + /** + * DeleteRegionRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @instance + */ + DeleteRegionRequest.prototype.name = ""; + + /** + * Creates a new DeleteRegionRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.DeleteRegionRequest} DeleteRegionRequest instance + */ + DeleteRegionRequest.create = function create(properties) { + return new DeleteRegionRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteRegionRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest} message DeleteRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionRequest.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 DeleteRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteRegionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest} message DeleteRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @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.DeleteRegionRequest} DeleteRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionRequest.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.DeleteRegionRequest(); + 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 DeleteRegionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.DeleteRegionRequest} DeleteRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionRequest.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 DeleteRegionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.DeleteRegionRequest} DeleteRegionRequest + */ + DeleteRegionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.DeleteRegionRequest} message DeleteRegionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionRequest.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 DeleteRegionRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRegionRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRegionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DeleteRegionRequest"; + }; + + return DeleteRegionRequest; + })(); + + v1beta.ListRegionsRequest = (function() { + + /** + * Properties of a ListRegionsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListRegionsRequest + * @property {string|null} [parent] ListRegionsRequest parent + * @property {number|null} [pageSize] ListRegionsRequest pageSize + * @property {string|null} [pageToken] ListRegionsRequest pageToken + */ + + /** + * Constructs a new ListRegionsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListRegionsRequest. + * @implements IListRegionsRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest=} [properties] Properties to set + */ + function ListRegionsRequest(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]]; + } + + /** + * ListRegionsRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @instance + */ + ListRegionsRequest.prototype.parent = ""; + + /** + * ListRegionsRequest pageSize. + * @member {number} pageSize + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @instance + */ + ListRegionsRequest.prototype.pageSize = 0; + + /** + * ListRegionsRequest pageToken. + * @member {string} pageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @instance + */ + ListRegionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListRegionsRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsRequest} ListRegionsRequest instance + */ + ListRegionsRequest.create = function create(properties) { + return new ListRegionsRequest(properties); + }; + + /** + * Encodes the specified ListRegionsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest} message ListRegionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListRegionsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest} message ListRegionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @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.ListRegionsRequest} ListRegionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionsRequest.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.ListRegionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsRequest} ListRegionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionsRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListRegionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsRequest} ListRegionsRequest + */ + ListRegionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListRegionsRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListRegionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListRegionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListRegionsRequest} message ListRegionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListRegionsRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRegionsRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRegionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListRegionsRequest"; + }; + + return ListRegionsRequest; + })(); + + v1beta.ListRegionsResponse = (function() { + + /** + * Properties of a ListRegionsResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IListRegionsResponse + * @property {Array.|null} [regions] ListRegionsResponse regions + * @property {string|null} [nextPageToken] ListRegionsResponse nextPageToken + */ + + /** + * Constructs a new ListRegionsResponse. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ListRegionsResponse. + * @implements IListRegionsResponse + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsResponse=} [properties] Properties to set + */ + function ListRegionsResponse(properties) { + this.regions = []; + 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]]; + } + + /** + * ListRegionsResponse regions. + * @member {Array.} regions + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @instance + */ + ListRegionsResponse.prototype.regions = $util.emptyArray; + + /** + * ListRegionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @instance + */ + ListRegionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRegionsResponse instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsResponse=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} ListRegionsResponse instance + */ + ListRegionsResponse.create = function create(properties) { + return new ListRegionsResponse(properties); + }; + + /** + * Encodes the specified ListRegionsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsResponse.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsResponse} message ListRegionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regions != null && message.regions.length) + for (var i = 0; i < message.regions.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Region.encode(message.regions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListRegionsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IListRegionsResponse} message ListRegionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @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.ListRegionsResponse} ListRegionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionsResponse.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.ListRegionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.regions && message.regions.length)) + message.regions = []; + message.regions.push($root.google.shopping.merchant.accounts.v1beta.Region.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} ListRegionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionsResponse message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regions != null && message.hasOwnProperty("regions")) { + if (!Array.isArray(message.regions)) + return "regions: array expected"; + for (var i = 0; i < message.regions.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Region.verify(message.regions[i]); + if (error) + return "regions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRegionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} ListRegionsResponse + */ + ListRegionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListRegionsResponse) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ListRegionsResponse(); + if (object.regions) { + if (!Array.isArray(object.regions)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListRegionsResponse.regions: array expected"); + message.regions = []; + for (var i = 0; i < object.regions.length; ++i) { + if (typeof object.regions[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ListRegionsResponse.regions: object expected"); + message.regions[i] = $root.google.shopping.merchant.accounts.v1beta.Region.fromObject(object.regions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRegionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @static + * @param {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} message ListRegionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.regions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.regions && message.regions.length) { + object.regions = []; + for (var j = 0; j < message.regions.length; ++j) + object.regions[j] = $root.google.shopping.merchant.accounts.v1beta.Region.toObject(message.regions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRegionsResponse to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRegionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRegionsResponse + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRegionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListRegionsResponse"; + }; + + return ListRegionsResponse; + })(); + + v1beta.Region = (function() { + + /** + * Properties of a Region. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IRegion + * @property {string|null} [name] Region name + * @property {string|null} [displayName] Region displayName + * @property {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea|null} [postalCodeArea] Region postalCodeArea + * @property {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea|null} [geotargetArea] Region geotargetArea + * @property {google.protobuf.IBoolValue|null} [regionalInventoryEligible] Region regionalInventoryEligible + * @property {google.protobuf.IBoolValue|null} [shippingEligible] Region shippingEligible + */ + + /** + * Constructs a new Region. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Region. + * @implements IRegion + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IRegion=} [properties] Properties to set + */ + function Region(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]]; + } + + /** + * Region name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @instance + */ + Region.prototype.name = ""; + + /** + * Region displayName. + * @member {string|null|undefined} displayName + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @instance + */ + Region.prototype.displayName = null; + + /** + * Region postalCodeArea. + * @member {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea|null|undefined} postalCodeArea + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @instance + */ + Region.prototype.postalCodeArea = null; + + /** + * Region geotargetArea. + * @member {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea|null|undefined} geotargetArea + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @instance + */ + Region.prototype.geotargetArea = null; + + /** + * Region regionalInventoryEligible. + * @member {google.protobuf.IBoolValue|null|undefined} regionalInventoryEligible + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @instance + */ + Region.prototype.regionalInventoryEligible = null; + + /** + * Region shippingEligible. + * @member {google.protobuf.IBoolValue|null|undefined} shippingEligible + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @instance + */ + Region.prototype.shippingEligible = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Region _displayName. + * @member {"displayName"|undefined} _displayName + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Region instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRegion=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Region} Region instance + */ + Region.create = function create(properties) { + return new Region(properties); + }; + + /** + * Encodes the specified Region message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRegion} message Region message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Region.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.postalCodeArea != null && Object.hasOwnProperty.call(message, "postalCodeArea")) + $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.encode(message.postalCodeArea, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.geotargetArea != null && Object.hasOwnProperty.call(message, "geotargetArea")) + $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.encode(message.geotargetArea, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.regionalInventoryEligible != null && Object.hasOwnProperty.call(message, "regionalInventoryEligible")) + $root.google.protobuf.BoolValue.encode(message.regionalInventoryEligible, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.shippingEligible != null && Object.hasOwnProperty.call(message, "shippingEligible")) + $root.google.protobuf.BoolValue.encode(message.shippingEligible, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Region message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRegion} message Region message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Region.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Region message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @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.Region} Region + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Region.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.Region(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.postalCodeArea = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.decode(reader, reader.uint32()); + break; + } + case 4: { + message.geotargetArea = $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.decode(reader, reader.uint32()); + break; + } + case 5: { + message.regionalInventoryEligible = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 6: { + message.shippingEligible = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Region message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Region} Region + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Region.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Region message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Region.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + if (message.postalCodeArea != null && message.hasOwnProperty("postalCodeArea")) { + var error = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify(message.postalCodeArea); + if (error) + return "postalCodeArea." + error; + } + if (message.geotargetArea != null && message.hasOwnProperty("geotargetArea")) { + var error = $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify(message.geotargetArea); + if (error) + return "geotargetArea." + error; + } + if (message.regionalInventoryEligible != null && message.hasOwnProperty("regionalInventoryEligible")) { + var error = $root.google.protobuf.BoolValue.verify(message.regionalInventoryEligible); + if (error) + return "regionalInventoryEligible." + error; + } + if (message.shippingEligible != null && message.hasOwnProperty("shippingEligible")) { + var error = $root.google.protobuf.BoolValue.verify(message.shippingEligible); + if (error) + return "shippingEligible." + error; + } + return null; + }; + + /** + * Creates a Region message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Region} Region + */ + Region.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Region) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Region(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.postalCodeArea != null) { + if (typeof object.postalCodeArea !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.postalCodeArea: object expected"); + message.postalCodeArea = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.fromObject(object.postalCodeArea); + } + if (object.geotargetArea != null) { + if (typeof object.geotargetArea !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.geotargetArea: object expected"); + message.geotargetArea = $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.fromObject(object.geotargetArea); + } + if (object.regionalInventoryEligible != null) { + if (typeof object.regionalInventoryEligible !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.regionalInventoryEligible: object expected"); + message.regionalInventoryEligible = $root.google.protobuf.BoolValue.fromObject(object.regionalInventoryEligible); + } + if (object.shippingEligible != null) { + if (typeof object.shippingEligible !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.shippingEligible: object expected"); + message.shippingEligible = $root.google.protobuf.BoolValue.fromObject(object.shippingEligible); + } + return message; + }; + + /** + * Creates a plain object from a Region message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region} message Region + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Region.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.postalCodeArea = null; + object.geotargetArea = null; + object.regionalInventoryEligible = null; + object.shippingEligible = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + if (message.postalCodeArea != null && message.hasOwnProperty("postalCodeArea")) + object.postalCodeArea = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.toObject(message.postalCodeArea, options); + if (message.geotargetArea != null && message.hasOwnProperty("geotargetArea")) + object.geotargetArea = $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.toObject(message.geotargetArea, options); + if (message.regionalInventoryEligible != null && message.hasOwnProperty("regionalInventoryEligible")) + object.regionalInventoryEligible = $root.google.protobuf.BoolValue.toObject(message.regionalInventoryEligible, options); + if (message.shippingEligible != null && message.hasOwnProperty("shippingEligible")) + object.shippingEligible = $root.google.protobuf.BoolValue.toObject(message.shippingEligible, options); + return object; + }; + + /** + * Converts this Region to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @instance + * @returns {Object.} JSON object + */ + Region.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Region + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Region.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Region"; + }; + + Region.PostalCodeArea = (function() { + + /** + * Properties of a PostalCodeArea. + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @interface IPostalCodeArea + * @property {string|null} [regionCode] PostalCodeArea regionCode + * @property {Array.|null} [postalCodes] PostalCodeArea postalCodes + */ + + /** + * Constructs a new PostalCodeArea. + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @classdesc Represents a PostalCodeArea. + * @implements IPostalCodeArea + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea=} [properties] Properties to set + */ + function PostalCodeArea(properties) { + this.postalCodes = []; + 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]]; + } + + /** + * PostalCodeArea regionCode. + * @member {string} regionCode + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @instance + */ + PostalCodeArea.prototype.regionCode = ""; + + /** + * PostalCodeArea postalCodes. + * @member {Array.} postalCodes + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @instance + */ + PostalCodeArea.prototype.postalCodes = $util.emptyArray; + + /** + * Creates a new PostalCodeArea instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea} PostalCodeArea instance + */ + PostalCodeArea.create = function create(properties) { + return new PostalCodeArea(properties); + }; + + /** + * Encodes the specified PostalCodeArea message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea} message PostalCodeArea message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalCodeArea.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); + if (message.postalCodes != null && message.postalCodes.length) + for (var i = 0; i < message.postalCodes.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.encode(message.postalCodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PostalCodeArea message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea} message PostalCodeArea message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalCodeArea.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostalCodeArea message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @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.Region.PostalCodeArea} PostalCodeArea + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalCodeArea.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.Region.PostalCodeArea(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.regionCode = reader.string(); + break; + } + case 2: { + if (!(message.postalCodes && message.postalCodes.length)) + message.postalCodes = []; + message.postalCodes.push($root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostalCodeArea message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea} PostalCodeArea + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalCodeArea.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostalCodeArea message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostalCodeArea.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.postalCodes != null && message.hasOwnProperty("postalCodes")) { + if (!Array.isArray(message.postalCodes)) + return "postalCodes: array expected"; + for (var i = 0; i < message.postalCodes.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify(message.postalCodes[i]); + if (error) + return "postalCodes." + error; + } + } + return null; + }; + + /** + * Creates a PostalCodeArea message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea} PostalCodeArea + */ + PostalCodeArea.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea(); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.postalCodes) { + if (!Array.isArray(object.postalCodes)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.postalCodes: array expected"); + message.postalCodes = []; + for (var i = 0; i < object.postalCodes.length; ++i) { + if (typeof object.postalCodes[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.postalCodes: object expected"); + message.postalCodes[i] = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.fromObject(object.postalCodes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PostalCodeArea message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea} message PostalCodeArea + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostalCodeArea.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.postalCodes = []; + if (options.defaults) + object.regionCode = ""; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.postalCodes && message.postalCodes.length) { + object.postalCodes = []; + for (var j = 0; j < message.postalCodes.length; ++j) + object.postalCodes[j] = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.toObject(message.postalCodes[j], options); + } + return object; + }; + + /** + * Converts this PostalCodeArea to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @instance + * @returns {Object.} JSON object + */ + PostalCodeArea.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostalCodeArea + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostalCodeArea.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea"; + }; + + PostalCodeArea.PostalCodeRange = (function() { + + /** + * Properties of a PostalCodeRange. + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @interface IPostalCodeRange + * @property {string|null} [begin] PostalCodeRange begin + * @property {string|null} [end] PostalCodeRange end + */ + + /** + * Constructs a new PostalCodeRange. + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea + * @classdesc Represents a PostalCodeRange. + * @implements IPostalCodeRange + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange=} [properties] Properties to set + */ + function PostalCodeRange(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]]; + } + + /** + * PostalCodeRange begin. + * @member {string} begin + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @instance + */ + PostalCodeRange.prototype.begin = ""; + + /** + * PostalCodeRange end. + * @member {string} end + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @instance + */ + PostalCodeRange.prototype.end = ""; + + /** + * Creates a new PostalCodeRange instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange} PostalCodeRange instance + */ + PostalCodeRange.create = function create(properties) { + return new PostalCodeRange(properties); + }; + + /** + * Encodes the specified PostalCodeRange message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange} message PostalCodeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalCodeRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.end); + return writer; + }; + + /** + * Encodes the specified PostalCodeRange message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange} message PostalCodeRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalCodeRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostalCodeRange message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @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.Region.PostalCodeArea.PostalCodeRange} PostalCodeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalCodeRange.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.Region.PostalCodeArea.PostalCodeRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.begin = reader.string(); + break; + } + case 2: { + message.end = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostalCodeRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange} PostalCodeRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalCodeRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostalCodeRange message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostalCodeRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isString(message.begin)) + return "begin: string expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isString(message.end)) + return "end: string expected"; + return null; + }; + + /** + * Creates a PostalCodeRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange} PostalCodeRange + */ + PostalCodeRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange(); + if (object.begin != null) + message.begin = String(object.begin); + if (object.end != null) + message.end = String(object.end); + return message; + }; + + /** + * Creates a plain object from a PostalCodeRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange} message PostalCodeRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostalCodeRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.begin = ""; + object.end = ""; + } + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this PostalCodeRange to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @instance + * @returns {Object.} JSON object + */ + PostalCodeRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostalCodeRange + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostalCodeRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange"; + }; + + return PostalCodeRange; + })(); + + return PostalCodeArea; + })(); + + Region.GeoTargetArea = (function() { + + /** + * Properties of a GeoTargetArea. + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @interface IGeoTargetArea + * @property {Array.|null} [geotargetCriteriaIds] GeoTargetArea geotargetCriteriaIds + */ + + /** + * Constructs a new GeoTargetArea. + * @memberof google.shopping.merchant.accounts.v1beta.Region + * @classdesc Represents a GeoTargetArea. + * @implements IGeoTargetArea + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea=} [properties] Properties to set + */ + function GeoTargetArea(properties) { + this.geotargetCriteriaIds = []; + 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]]; + } + + /** + * GeoTargetArea geotargetCriteriaIds. + * @member {Array.} geotargetCriteriaIds + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @instance + */ + GeoTargetArea.prototype.geotargetCriteriaIds = $util.emptyArray; + + /** + * Creates a new GeoTargetArea instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea} GeoTargetArea instance + */ + GeoTargetArea.create = function create(properties) { + return new GeoTargetArea(properties); + }; + + /** + * Encodes the specified GeoTargetArea message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea} message GeoTargetArea message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeoTargetArea.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.geotargetCriteriaIds != null && message.geotargetCriteriaIds.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.geotargetCriteriaIds.length; ++i) + writer.int64(message.geotargetCriteriaIds[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified GeoTargetArea message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea} message GeoTargetArea message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeoTargetArea.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeoTargetArea message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @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.Region.GeoTargetArea} GeoTargetArea + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeoTargetArea.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.Region.GeoTargetArea(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.geotargetCriteriaIds && message.geotargetCriteriaIds.length)) + message.geotargetCriteriaIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.geotargetCriteriaIds.push(reader.int64()); + } else + message.geotargetCriteriaIds.push(reader.int64()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeoTargetArea message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea} GeoTargetArea + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeoTargetArea.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeoTargetArea message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeoTargetArea.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.geotargetCriteriaIds != null && message.hasOwnProperty("geotargetCriteriaIds")) { + if (!Array.isArray(message.geotargetCriteriaIds)) + return "geotargetCriteriaIds: array expected"; + for (var i = 0; i < message.geotargetCriteriaIds.length; ++i) + if (!$util.isInteger(message.geotargetCriteriaIds[i]) && !(message.geotargetCriteriaIds[i] && $util.isInteger(message.geotargetCriteriaIds[i].low) && $util.isInteger(message.geotargetCriteriaIds[i].high))) + return "geotargetCriteriaIds: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a GeoTargetArea message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea} GeoTargetArea + */ + GeoTargetArea.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea(); + if (object.geotargetCriteriaIds) { + if (!Array.isArray(object.geotargetCriteriaIds)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.geotargetCriteriaIds: array expected"); + message.geotargetCriteriaIds = []; + for (var i = 0; i < object.geotargetCriteriaIds.length; ++i) + if ($util.Long) + (message.geotargetCriteriaIds[i] = $util.Long.fromValue(object.geotargetCriteriaIds[i])).unsigned = false; + else if (typeof object.geotargetCriteriaIds[i] === "string") + message.geotargetCriteriaIds[i] = parseInt(object.geotargetCriteriaIds[i], 10); + else if (typeof object.geotargetCriteriaIds[i] === "number") + message.geotargetCriteriaIds[i] = object.geotargetCriteriaIds[i]; + else if (typeof object.geotargetCriteriaIds[i] === "object") + message.geotargetCriteriaIds[i] = new $util.LongBits(object.geotargetCriteriaIds[i].low >>> 0, object.geotargetCriteriaIds[i].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a GeoTargetArea message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @static + * @param {google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea} message GeoTargetArea + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeoTargetArea.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.geotargetCriteriaIds = []; + if (message.geotargetCriteriaIds && message.geotargetCriteriaIds.length) { + object.geotargetCriteriaIds = []; + for (var j = 0; j < message.geotargetCriteriaIds.length; ++j) + if (typeof message.geotargetCriteriaIds[j] === "number") + object.geotargetCriteriaIds[j] = options.longs === String ? String(message.geotargetCriteriaIds[j]) : message.geotargetCriteriaIds[j]; + else + object.geotargetCriteriaIds[j] = options.longs === String ? $util.Long.prototype.toString.call(message.geotargetCriteriaIds[j]) : options.longs === Number ? new $util.LongBits(message.geotargetCriteriaIds[j].low >>> 0, message.geotargetCriteriaIds[j].high >>> 0).toNumber() : message.geotargetCriteriaIds[j]; + } + return object; + }; + + /** + * Converts this GeoTargetArea to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @instance + * @returns {Object.} JSON object + */ + GeoTargetArea.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeoTargetArea + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeoTargetArea.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea"; + }; + + return GeoTargetArea; + })(); + + return Region; + })(); + + v1beta.ShippingSettingsService = (function() { + + /** + * Constructs a new ShippingSettingsService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ShippingSettingsService + * @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 ShippingSettingsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ShippingSettingsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ShippingSettingsService; + + /** + * Creates new ShippingSettingsService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService + * @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 {ShippingSettingsService} RPC service. Useful where requests and/or responses are streamed. + */ + ShippingSettingsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ShippingSettingsService|getShippingSettings}. + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService + * @typedef GetShippingSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ShippingSettings} [response] ShippingSettings + */ + + /** + * Calls GetShippingSettings. + * @function getShippingSettings + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest} request GetShippingSettingsRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.ShippingSettingsService.GetShippingSettingsCallback} callback Node-style callback called with the error, if any, and ShippingSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ShippingSettingsService.prototype.getShippingSettings = function getShippingSettings(request, callback) { + return this.rpcCall(getShippingSettings, $root.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest, $root.google.shopping.merchant.accounts.v1beta.ShippingSettings, request, callback); + }, "name", { value: "GetShippingSettings" }); + + /** + * Calls GetShippingSettings. + * @function getShippingSettings + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest} request GetShippingSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ShippingSettingsService|insertShippingSettings}. + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService + * @typedef InsertShippingSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.ShippingSettings} [response] ShippingSettings + */ + + /** + * Calls InsertShippingSettings. + * @function insertShippingSettings + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest} request InsertShippingSettingsRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.ShippingSettingsService.InsertShippingSettingsCallback} callback Node-style callback called with the error, if any, and ShippingSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ShippingSettingsService.prototype.insertShippingSettings = function insertShippingSettings(request, callback) { + return this.rpcCall(insertShippingSettings, $root.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest, $root.google.shopping.merchant.accounts.v1beta.ShippingSettings, request, callback); + }, "name", { value: "InsertShippingSettings" }); + + /** + * Calls InsertShippingSettings. + * @function insertShippingSettings + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest} request InsertShippingSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ShippingSettingsService; + })(); + + v1beta.ShippingSettings = (function() { + + /** + * Properties of a ShippingSettings. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IShippingSettings + * @property {string|null} [name] ShippingSettings name + * @property {Array.|null} [services] ShippingSettings services + * @property {Array.|null} [warehouses] ShippingSettings warehouses + * @property {string|null} [etag] ShippingSettings etag + */ + + /** + * Constructs a new ShippingSettings. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a ShippingSettings. + * @implements IShippingSettings + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IShippingSettings=} [properties] Properties to set + */ + function ShippingSettings(properties) { + this.services = []; + this.warehouses = []; + 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]]; + } + + /** + * ShippingSettings name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @instance + */ + ShippingSettings.prototype.name = ""; + + /** + * ShippingSettings services. + * @member {Array.} services + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @instance + */ + ShippingSettings.prototype.services = $util.emptyArray; + + /** + * ShippingSettings warehouses. + * @member {Array.} warehouses + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @instance + */ + ShippingSettings.prototype.warehouses = $util.emptyArray; + + /** + * ShippingSettings etag. + * @member {string} etag + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @instance + */ + ShippingSettings.prototype.etag = ""; + + /** + * Creates a new ShippingSettings instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @static + * @param {google.shopping.merchant.accounts.v1beta.IShippingSettings=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.ShippingSettings} ShippingSettings instance + */ + ShippingSettings.create = function create(properties) { + return new ShippingSettings(properties); + }; + + /** + * Encodes the specified ShippingSettings message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ShippingSettings.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @static + * @param {google.shopping.merchant.accounts.v1beta.IShippingSettings} message ShippingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShippingSettings.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.services != null && message.services.length) + for (var i = 0; i < message.services.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Service.encode(message.services[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.warehouses != null && message.warehouses.length) + for (var i = 0; i < message.warehouses.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Warehouse.encode(message.warehouses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + return writer; + }; + + /** + * Encodes the specified ShippingSettings message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ShippingSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @static + * @param {google.shopping.merchant.accounts.v1beta.IShippingSettings} message ShippingSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShippingSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShippingSettings message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @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.ShippingSettings} ShippingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShippingSettings.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.ShippingSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.services && message.services.length)) + message.services = []; + message.services.push($root.google.shopping.merchant.accounts.v1beta.Service.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.warehouses && message.warehouses.length)) + message.warehouses = []; + message.warehouses.push($root.google.shopping.merchant.accounts.v1beta.Warehouse.decode(reader, reader.uint32())); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShippingSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.ShippingSettings} ShippingSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShippingSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShippingSettings message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShippingSettings.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.services != null && message.hasOwnProperty("services")) { + if (!Array.isArray(message.services)) + return "services: array expected"; + for (var i = 0; i < message.services.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Service.verify(message.services[i]); + if (error) + return "services." + error; + } + } + if (message.warehouses != null && message.hasOwnProperty("warehouses")) { + if (!Array.isArray(message.warehouses)) + return "warehouses: array expected"; + for (var i = 0; i < message.warehouses.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Warehouse.verify(message.warehouses[i]); + if (error) + return "warehouses." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a ShippingSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.ShippingSettings} ShippingSettings + */ + ShippingSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ShippingSettings) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.ShippingSettings(); + if (object.name != null) + message.name = String(object.name); + if (object.services) { + if (!Array.isArray(object.services)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ShippingSettings.services: array expected"); + message.services = []; + for (var i = 0; i < object.services.length; ++i) { + if (typeof object.services[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ShippingSettings.services: object expected"); + message.services[i] = $root.google.shopping.merchant.accounts.v1beta.Service.fromObject(object.services[i]); + } + } + if (object.warehouses) { + if (!Array.isArray(object.warehouses)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.ShippingSettings.warehouses: array expected"); + message.warehouses = []; + for (var i = 0; i < object.warehouses.length; ++i) { + if (typeof object.warehouses[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.ShippingSettings.warehouses: object expected"); + message.warehouses[i] = $root.google.shopping.merchant.accounts.v1beta.Warehouse.fromObject(object.warehouses[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a ShippingSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @static + * @param {google.shopping.merchant.accounts.v1beta.ShippingSettings} message ShippingSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShippingSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.services = []; + object.warehouses = []; + } + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.services && message.services.length) { + object.services = []; + for (var j = 0; j < message.services.length; ++j) + object.services[j] = $root.google.shopping.merchant.accounts.v1beta.Service.toObject(message.services[j], options); + } + if (message.warehouses && message.warehouses.length) { + object.warehouses = []; + for (var j = 0; j < message.warehouses.length; ++j) + object.warehouses[j] = $root.google.shopping.merchant.accounts.v1beta.Warehouse.toObject(message.warehouses[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this ShippingSettings to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @instance + * @returns {Object.} JSON object + */ + ShippingSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShippingSettings + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShippingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ShippingSettings"; + }; + + return ShippingSettings; + })(); + + v1beta.Service = (function() { + + /** + * Properties of a Service. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IService + * @property {string|null} [serviceName] Service serviceName + * @property {boolean|null} [active] Service active + * @property {Array.|null} [deliveryCountries] Service deliveryCountries + * @property {string|null} [currencyCode] Service currencyCode + * @property {google.shopping.merchant.accounts.v1beta.IDeliveryTime|null} [deliveryTime] Service deliveryTime + * @property {Array.|null} [rateGroups] Service rateGroups + * @property {google.shopping.merchant.accounts.v1beta.Service.ShipmentType|null} [shipmentType] Service shipmentType + * @property {google.shopping.type.IPrice|null} [minimumOrderValue] Service minimumOrderValue + * @property {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable|null} [minimumOrderValueTable] Service minimumOrderValueTable + * @property {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig|null} [storeConfig] Service storeConfig + * @property {Array.|null} [loyaltyPrograms] Service loyaltyPrograms + */ + + /** + * Constructs a new Service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Service. + * @implements IService + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IService=} [properties] Properties to set + */ + function Service(properties) { + this.deliveryCountries = []; + this.rateGroups = []; + this.loyaltyPrograms = []; + 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]]; + } + + /** + * Service serviceName. + * @member {string|null|undefined} serviceName + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.serviceName = null; + + /** + * Service active. + * @member {boolean|null|undefined} active + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.active = null; + + /** + * Service deliveryCountries. + * @member {Array.} deliveryCountries + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.deliveryCountries = $util.emptyArray; + + /** + * Service currencyCode. + * @member {string|null|undefined} currencyCode + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.currencyCode = null; + + /** + * Service deliveryTime. + * @member {google.shopping.merchant.accounts.v1beta.IDeliveryTime|null|undefined} deliveryTime + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.deliveryTime = null; + + /** + * Service rateGroups. + * @member {Array.} rateGroups + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.rateGroups = $util.emptyArray; + + /** + * Service shipmentType. + * @member {google.shopping.merchant.accounts.v1beta.Service.ShipmentType|null|undefined} shipmentType + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.shipmentType = null; + + /** + * Service minimumOrderValue. + * @member {google.shopping.type.IPrice|null|undefined} minimumOrderValue + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.minimumOrderValue = null; + + /** + * Service minimumOrderValueTable. + * @member {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable|null|undefined} minimumOrderValueTable + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.minimumOrderValueTable = null; + + /** + * Service storeConfig. + * @member {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig|null|undefined} storeConfig + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.storeConfig = null; + + /** + * Service loyaltyPrograms. + * @member {Array.} loyaltyPrograms + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Service.prototype.loyaltyPrograms = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Service _serviceName. + * @member {"serviceName"|undefined} _serviceName + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Object.defineProperty(Service.prototype, "_serviceName", { + get: $util.oneOfGetter($oneOfFields = ["serviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Service _active. + * @member {"active"|undefined} _active + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Object.defineProperty(Service.prototype, "_active", { + get: $util.oneOfGetter($oneOfFields = ["active"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Service _currencyCode. + * @member {"currencyCode"|undefined} _currencyCode + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Object.defineProperty(Service.prototype, "_currencyCode", { + get: $util.oneOfGetter($oneOfFields = ["currencyCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Service _deliveryTime. + * @member {"deliveryTime"|undefined} _deliveryTime + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Object.defineProperty(Service.prototype, "_deliveryTime", { + get: $util.oneOfGetter($oneOfFields = ["deliveryTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Service _shipmentType. + * @member {"shipmentType"|undefined} _shipmentType + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Object.defineProperty(Service.prototype, "_shipmentType", { + get: $util.oneOfGetter($oneOfFields = ["shipmentType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Service _minimumOrderValue. + * @member {"minimumOrderValue"|undefined} _minimumOrderValue + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Object.defineProperty(Service.prototype, "_minimumOrderValue", { + get: $util.oneOfGetter($oneOfFields = ["minimumOrderValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Service _minimumOrderValueTable. + * @member {"minimumOrderValueTable"|undefined} _minimumOrderValueTable + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Object.defineProperty(Service.prototype, "_minimumOrderValueTable", { + get: $util.oneOfGetter($oneOfFields = ["minimumOrderValueTable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Service _storeConfig. + * @member {"storeConfig"|undefined} _storeConfig + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + */ + Object.defineProperty(Service.prototype, "_storeConfig", { + get: $util.oneOfGetter($oneOfFields = ["storeConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Service instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @static + * @param {google.shopping.merchant.accounts.v1beta.IService=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Service} Service instance + */ + Service.create = function create(properties) { + return new Service(properties); + }; + + /** + * Encodes the specified Service message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @static + * @param {google.shopping.merchant.accounts.v1beta.IService} message Service message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Service.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.active != null && Object.hasOwnProperty.call(message, "active")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.active); + if (message.deliveryCountries != null && message.deliveryCountries.length) + for (var i = 0; i < message.deliveryCountries.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.deliveryCountries[i]); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.currencyCode); + if (message.deliveryTime != null && Object.hasOwnProperty.call(message, "deliveryTime")) + $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.encode(message.deliveryTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.rateGroups != null && message.rateGroups.length) + for (var i = 0; i < message.rateGroups.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.RateGroup.encode(message.rateGroups[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.shipmentType != null && Object.hasOwnProperty.call(message, "shipmentType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.shipmentType); + if (message.minimumOrderValue != null && Object.hasOwnProperty.call(message, "minimumOrderValue")) + $root.google.shopping.type.Price.encode(message.minimumOrderValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.minimumOrderValueTable != null && Object.hasOwnProperty.call(message, "minimumOrderValueTable")) + $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.encode(message.minimumOrderValueTable, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.storeConfig != null && Object.hasOwnProperty.call(message, "storeConfig")) + $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.encode(message.storeConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.loyaltyPrograms != null && message.loyaltyPrograms.length) + for (var i = 0; i < message.loyaltyPrograms.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.encode(message.loyaltyPrograms[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Service message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @static + * @param {google.shopping.merchant.accounts.v1beta.IService} message Service message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Service.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Service message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @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.Service} Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Service.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.Service(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.active = reader.bool(); + break; + } + case 3: { + if (!(message.deliveryCountries && message.deliveryCountries.length)) + message.deliveryCountries = []; + message.deliveryCountries.push(reader.string()); + break; + } + case 4: { + message.currencyCode = reader.string(); + break; + } + case 5: { + message.deliveryTime = $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.rateGroups && message.rateGroups.length)) + message.rateGroups = []; + message.rateGroups.push($root.google.shopping.merchant.accounts.v1beta.RateGroup.decode(reader, reader.uint32())); + break; + } + case 7: { + message.shipmentType = reader.int32(); + break; + } + case 8: { + message.minimumOrderValue = $root.google.shopping.type.Price.decode(reader, reader.uint32()); + break; + } + case 9: { + message.minimumOrderValueTable = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.decode(reader, reader.uint32()); + break; + } + case 10: { + message.storeConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.loyaltyPrograms && message.loyaltyPrograms.length)) + message.loyaltyPrograms = []; + message.loyaltyPrograms.push($root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Service message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Service} Service + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Service.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Service message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Service.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) { + properties._serviceName = 1; + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + } + if (message.active != null && message.hasOwnProperty("active")) { + properties._active = 1; + if (typeof message.active !== "boolean") + return "active: boolean expected"; + } + if (message.deliveryCountries != null && message.hasOwnProperty("deliveryCountries")) { + if (!Array.isArray(message.deliveryCountries)) + return "deliveryCountries: array expected"; + for (var i = 0; i < message.deliveryCountries.length; ++i) + if (!$util.isString(message.deliveryCountries[i])) + return "deliveryCountries: string[] expected"; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { + properties._currencyCode = 1; + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + } + if (message.deliveryTime != null && message.hasOwnProperty("deliveryTime")) { + properties._deliveryTime = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.verify(message.deliveryTime); + if (error) + return "deliveryTime." + error; + } + } + if (message.rateGroups != null && message.hasOwnProperty("rateGroups")) { + if (!Array.isArray(message.rateGroups)) + return "rateGroups: array expected"; + for (var i = 0; i < message.rateGroups.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.RateGroup.verify(message.rateGroups[i]); + if (error) + return "rateGroups." + error; + } + } + if (message.shipmentType != null && message.hasOwnProperty("shipmentType")) { + properties._shipmentType = 1; + switch (message.shipmentType) { + default: + return "shipmentType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.minimumOrderValue != null && message.hasOwnProperty("minimumOrderValue")) { + properties._minimumOrderValue = 1; + { + var error = $root.google.shopping.type.Price.verify(message.minimumOrderValue); + if (error) + return "minimumOrderValue." + error; + } + } + if (message.minimumOrderValueTable != null && message.hasOwnProperty("minimumOrderValueTable")) { + properties._minimumOrderValueTable = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify(message.minimumOrderValueTable); + if (error) + return "minimumOrderValueTable." + error; + } + } + if (message.storeConfig != null && message.hasOwnProperty("storeConfig")) { + properties._storeConfig = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify(message.storeConfig); + if (error) + return "storeConfig." + error; + } + } + if (message.loyaltyPrograms != null && message.hasOwnProperty("loyaltyPrograms")) { + if (!Array.isArray(message.loyaltyPrograms)) + return "loyaltyPrograms: array expected"; + for (var i = 0; i < message.loyaltyPrograms.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify(message.loyaltyPrograms[i]); + if (error) + return "loyaltyPrograms." + error; + } + } + return null; + }; + + /** + * Creates a Service message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Service} Service + */ + Service.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Service(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.active != null) + message.active = Boolean(object.active); + if (object.deliveryCountries) { + if (!Array.isArray(object.deliveryCountries)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.deliveryCountries: array expected"); + message.deliveryCountries = []; + for (var i = 0; i < object.deliveryCountries.length; ++i) + message.deliveryCountries[i] = String(object.deliveryCountries[i]); + } + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.deliveryTime != null) { + if (typeof object.deliveryTime !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.deliveryTime: object expected"); + message.deliveryTime = $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.fromObject(object.deliveryTime); + } + if (object.rateGroups) { + if (!Array.isArray(object.rateGroups)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.rateGroups: array expected"); + message.rateGroups = []; + for (var i = 0; i < object.rateGroups.length; ++i) { + if (typeof object.rateGroups[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.rateGroups: object expected"); + message.rateGroups[i] = $root.google.shopping.merchant.accounts.v1beta.RateGroup.fromObject(object.rateGroups[i]); + } + } + switch (object.shipmentType) { + default: + if (typeof object.shipmentType === "number") { + message.shipmentType = object.shipmentType; + break; + } + break; + case "SHIPMENT_TYPE_UNSPECIFIED": + case 0: + message.shipmentType = 0; + break; + case "DELIVERY": + case 1: + message.shipmentType = 1; + break; + case "LOCAL_DELIVERY": + case 2: + message.shipmentType = 2; + break; + case "COLLECTION_POINT": + case 3: + message.shipmentType = 3; + break; + } + if (object.minimumOrderValue != null) { + if (typeof object.minimumOrderValue !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.minimumOrderValue: object expected"); + message.minimumOrderValue = $root.google.shopping.type.Price.fromObject(object.minimumOrderValue); + } + if (object.minimumOrderValueTable != null) { + if (typeof object.minimumOrderValueTable !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.minimumOrderValueTable: object expected"); + message.minimumOrderValueTable = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.fromObject(object.minimumOrderValueTable); + } + if (object.storeConfig != null) { + if (typeof object.storeConfig !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.storeConfig: object expected"); + message.storeConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.fromObject(object.storeConfig); + } + if (object.loyaltyPrograms) { + if (!Array.isArray(object.loyaltyPrograms)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.loyaltyPrograms: array expected"); + message.loyaltyPrograms = []; + for (var i = 0; i < object.loyaltyPrograms.length; ++i) { + if (typeof object.loyaltyPrograms[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.loyaltyPrograms: object expected"); + message.loyaltyPrograms[i] = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.fromObject(object.loyaltyPrograms[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Service message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service} message Service + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Service.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.deliveryCountries = []; + object.rateGroups = []; + object.loyaltyPrograms = []; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) { + object.serviceName = message.serviceName; + if (options.oneofs) + object._serviceName = "serviceName"; + } + if (message.active != null && message.hasOwnProperty("active")) { + object.active = message.active; + if (options.oneofs) + object._active = "active"; + } + if (message.deliveryCountries && message.deliveryCountries.length) { + object.deliveryCountries = []; + for (var j = 0; j < message.deliveryCountries.length; ++j) + object.deliveryCountries[j] = message.deliveryCountries[j]; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { + object.currencyCode = message.currencyCode; + if (options.oneofs) + object._currencyCode = "currencyCode"; + } + if (message.deliveryTime != null && message.hasOwnProperty("deliveryTime")) { + object.deliveryTime = $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.toObject(message.deliveryTime, options); + if (options.oneofs) + object._deliveryTime = "deliveryTime"; + } + if (message.rateGroups && message.rateGroups.length) { + object.rateGroups = []; + for (var j = 0; j < message.rateGroups.length; ++j) + object.rateGroups[j] = $root.google.shopping.merchant.accounts.v1beta.RateGroup.toObject(message.rateGroups[j], options); + } + if (message.shipmentType != null && message.hasOwnProperty("shipmentType")) { + object.shipmentType = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.Service.ShipmentType[message.shipmentType] === undefined ? message.shipmentType : $root.google.shopping.merchant.accounts.v1beta.Service.ShipmentType[message.shipmentType] : message.shipmentType; + if (options.oneofs) + object._shipmentType = "shipmentType"; + } + if (message.minimumOrderValue != null && message.hasOwnProperty("minimumOrderValue")) { + object.minimumOrderValue = $root.google.shopping.type.Price.toObject(message.minimumOrderValue, options); + if (options.oneofs) + object._minimumOrderValue = "minimumOrderValue"; + } + if (message.minimumOrderValueTable != null && message.hasOwnProperty("minimumOrderValueTable")) { + object.minimumOrderValueTable = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.toObject(message.minimumOrderValueTable, options); + if (options.oneofs) + object._minimumOrderValueTable = "minimumOrderValueTable"; + } + if (message.storeConfig != null && message.hasOwnProperty("storeConfig")) { + object.storeConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.toObject(message.storeConfig, options); + if (options.oneofs) + object._storeConfig = "storeConfig"; + } + if (message.loyaltyPrograms && message.loyaltyPrograms.length) { + object.loyaltyPrograms = []; + for (var j = 0; j < message.loyaltyPrograms.length; ++j) + object.loyaltyPrograms[j] = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.toObject(message.loyaltyPrograms[j], options); + } + return object; + }; + + /** + * Converts this Service to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @instance + * @returns {Object.} JSON object + */ + Service.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Service + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Service.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service"; + }; + + Service.StoreConfig = (function() { + + /** + * Properties of a StoreConfig. + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @interface IStoreConfig + * @property {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|null} [storeServiceType] StoreConfig storeServiceType + * @property {Array.|null} [storeCodes] StoreConfig storeCodes + * @property {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig|null} [cutoffConfig] StoreConfig cutoffConfig + * @property {google.shopping.merchant.accounts.v1beta.IDistance|null} [serviceRadius] StoreConfig serviceRadius + */ + + /** + * Constructs a new StoreConfig. + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @classdesc Represents a StoreConfig. + * @implements IStoreConfig + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig=} [properties] Properties to set + */ + function StoreConfig(properties) { + this.storeCodes = []; + 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]]; + } + + /** + * StoreConfig storeServiceType. + * @member {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|null|undefined} storeServiceType + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @instance + */ + StoreConfig.prototype.storeServiceType = null; + + /** + * StoreConfig storeCodes. + * @member {Array.} storeCodes + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @instance + */ + StoreConfig.prototype.storeCodes = $util.emptyArray; + + /** + * StoreConfig cutoffConfig. + * @member {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig|null|undefined} cutoffConfig + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @instance + */ + StoreConfig.prototype.cutoffConfig = null; + + /** + * StoreConfig serviceRadius. + * @member {google.shopping.merchant.accounts.v1beta.IDistance|null|undefined} serviceRadius + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @instance + */ + StoreConfig.prototype.serviceRadius = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StoreConfig _storeServiceType. + * @member {"storeServiceType"|undefined} _storeServiceType + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @instance + */ + Object.defineProperty(StoreConfig.prototype, "_storeServiceType", { + get: $util.oneOfGetter($oneOfFields = ["storeServiceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * StoreConfig _cutoffConfig. + * @member {"cutoffConfig"|undefined} _cutoffConfig + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @instance + */ + Object.defineProperty(StoreConfig.prototype, "_cutoffConfig", { + get: $util.oneOfGetter($oneOfFields = ["cutoffConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * StoreConfig _serviceRadius. + * @member {"serviceRadius"|undefined} _serviceRadius + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @instance + */ + Object.defineProperty(StoreConfig.prototype, "_serviceRadius", { + get: $util.oneOfGetter($oneOfFields = ["serviceRadius"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StoreConfig instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig} StoreConfig instance + */ + StoreConfig.create = function create(properties) { + return new StoreConfig(properties); + }; + + /** + * Encodes the specified StoreConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig} message StoreConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoreConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.storeServiceType != null && Object.hasOwnProperty.call(message, "storeServiceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.storeServiceType); + if (message.storeCodes != null && message.storeCodes.length) + for (var i = 0; i < message.storeCodes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.storeCodes[i]); + if (message.cutoffConfig != null && Object.hasOwnProperty.call(message, "cutoffConfig")) + $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.encode(message.cutoffConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceRadius != null && Object.hasOwnProperty.call(message, "serviceRadius")) + $root.google.shopping.merchant.accounts.v1beta.Distance.encode(message.serviceRadius, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoreConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig} message StoreConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoreConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StoreConfig message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @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.Service.StoreConfig} StoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoreConfig.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.Service.StoreConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.storeServiceType = reader.int32(); + break; + } + case 2: { + if (!(message.storeCodes && message.storeCodes.length)) + message.storeCodes = []; + message.storeCodes.push(reader.string()); + break; + } + case 3: { + message.cutoffConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceRadius = $root.google.shopping.merchant.accounts.v1beta.Distance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StoreConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig} StoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoreConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoreConfig message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoreConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.storeServiceType != null && message.hasOwnProperty("storeServiceType")) { + properties._storeServiceType = 1; + switch (message.storeServiceType) { + default: + return "storeServiceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.storeCodes != null && message.hasOwnProperty("storeCodes")) { + if (!Array.isArray(message.storeCodes)) + return "storeCodes: array expected"; + for (var i = 0; i < message.storeCodes.length; ++i) + if (!$util.isString(message.storeCodes[i])) + return "storeCodes: string[] expected"; + } + if (message.cutoffConfig != null && message.hasOwnProperty("cutoffConfig")) { + properties._cutoffConfig = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify(message.cutoffConfig); + if (error) + return "cutoffConfig." + error; + } + } + if (message.serviceRadius != null && message.hasOwnProperty("serviceRadius")) { + properties._serviceRadius = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Distance.verify(message.serviceRadius); + if (error) + return "serviceRadius." + error; + } + } + return null; + }; + + /** + * Creates a StoreConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig} StoreConfig + */ + StoreConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig(); + switch (object.storeServiceType) { + default: + if (typeof object.storeServiceType === "number") { + message.storeServiceType = object.storeServiceType; + break; + } + break; + case "STORE_SERVICE_TYPE_UNSPECIFIED": + case 0: + message.storeServiceType = 0; + break; + case "ALL_STORES": + case 1: + message.storeServiceType = 1; + break; + case "SELECTED_STORES": + case 2: + message.storeServiceType = 2; + break; + } + if (object.storeCodes) { + if (!Array.isArray(object.storeCodes)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.StoreConfig.storeCodes: array expected"); + message.storeCodes = []; + for (var i = 0; i < object.storeCodes.length; ++i) + message.storeCodes[i] = String(object.storeCodes[i]); + } + if (object.cutoffConfig != null) { + if (typeof object.cutoffConfig !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.StoreConfig.cutoffConfig: object expected"); + message.cutoffConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.fromObject(object.cutoffConfig); + } + if (object.serviceRadius != null) { + if (typeof object.serviceRadius !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.StoreConfig.serviceRadius: object expected"); + message.serviceRadius = $root.google.shopping.merchant.accounts.v1beta.Distance.fromObject(object.serviceRadius); + } + return message; + }; + + /** + * Creates a plain object from a StoreConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig} message StoreConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoreConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.storeCodes = []; + if (message.storeServiceType != null && message.hasOwnProperty("storeServiceType")) { + object.storeServiceType = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType[message.storeServiceType] === undefined ? message.storeServiceType : $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType[message.storeServiceType] : message.storeServiceType; + if (options.oneofs) + object._storeServiceType = "storeServiceType"; + } + if (message.storeCodes && message.storeCodes.length) { + object.storeCodes = []; + for (var j = 0; j < message.storeCodes.length; ++j) + object.storeCodes[j] = message.storeCodes[j]; + } + if (message.cutoffConfig != null && message.hasOwnProperty("cutoffConfig")) { + object.cutoffConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.toObject(message.cutoffConfig, options); + if (options.oneofs) + object._cutoffConfig = "cutoffConfig"; + } + if (message.serviceRadius != null && message.hasOwnProperty("serviceRadius")) { + object.serviceRadius = $root.google.shopping.merchant.accounts.v1beta.Distance.toObject(message.serviceRadius, options); + if (options.oneofs) + object._serviceRadius = "serviceRadius"; + } + return object; + }; + + /** + * Converts this StoreConfig to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @instance + * @returns {Object.} JSON object + */ + StoreConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StoreConfig + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StoreConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.StoreConfig"; + }; + + StoreConfig.CutoffConfig = (function() { + + /** + * Properties of a CutoffConfig. + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @interface ICutoffConfig + * @property {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime|null} [localCutoffTime] CutoffConfig localCutoffTime + * @property {number|Long|null} [storeCloseOffsetHours] CutoffConfig storeCloseOffsetHours + * @property {boolean|null} [noDeliveryPostCutoff] CutoffConfig noDeliveryPostCutoff + */ + + /** + * Constructs a new CutoffConfig. + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig + * @classdesc Represents a CutoffConfig. + * @implements ICutoffConfig + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig=} [properties] Properties to set + */ + function CutoffConfig(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]]; + } + + /** + * CutoffConfig localCutoffTime. + * @member {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime|null|undefined} localCutoffTime + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @instance + */ + CutoffConfig.prototype.localCutoffTime = null; + + /** + * CutoffConfig storeCloseOffsetHours. + * @member {number|Long|null|undefined} storeCloseOffsetHours + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @instance + */ + CutoffConfig.prototype.storeCloseOffsetHours = null; + + /** + * CutoffConfig noDeliveryPostCutoff. + * @member {boolean|null|undefined} noDeliveryPostCutoff + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @instance + */ + CutoffConfig.prototype.noDeliveryPostCutoff = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CutoffConfig _localCutoffTime. + * @member {"localCutoffTime"|undefined} _localCutoffTime + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @instance + */ + Object.defineProperty(CutoffConfig.prototype, "_localCutoffTime", { + get: $util.oneOfGetter($oneOfFields = ["localCutoffTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CutoffConfig _storeCloseOffsetHours. + * @member {"storeCloseOffsetHours"|undefined} _storeCloseOffsetHours + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @instance + */ + Object.defineProperty(CutoffConfig.prototype, "_storeCloseOffsetHours", { + get: $util.oneOfGetter($oneOfFields = ["storeCloseOffsetHours"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CutoffConfig _noDeliveryPostCutoff. + * @member {"noDeliveryPostCutoff"|undefined} _noDeliveryPostCutoff + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @instance + */ + Object.defineProperty(CutoffConfig.prototype, "_noDeliveryPostCutoff", { + get: $util.oneOfGetter($oneOfFields = ["noDeliveryPostCutoff"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CutoffConfig instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig} CutoffConfig instance + */ + CutoffConfig.create = function create(properties) { + return new CutoffConfig(properties); + }; + + /** + * Encodes the specified CutoffConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig} message CutoffConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CutoffConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.localCutoffTime != null && Object.hasOwnProperty.call(message, "localCutoffTime")) + $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.encode(message.localCutoffTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.storeCloseOffsetHours != null && Object.hasOwnProperty.call(message, "storeCloseOffsetHours")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.storeCloseOffsetHours); + if (message.noDeliveryPostCutoff != null && Object.hasOwnProperty.call(message, "noDeliveryPostCutoff")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noDeliveryPostCutoff); + return writer; + }; + + /** + * Encodes the specified CutoffConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig} message CutoffConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CutoffConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CutoffConfig message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @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.Service.StoreConfig.CutoffConfig} CutoffConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CutoffConfig.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.Service.StoreConfig.CutoffConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.localCutoffTime = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.decode(reader, reader.uint32()); + break; + } + case 2: { + message.storeCloseOffsetHours = reader.int64(); + break; + } + case 3: { + message.noDeliveryPostCutoff = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CutoffConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig} CutoffConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CutoffConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CutoffConfig message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CutoffConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.localCutoffTime != null && message.hasOwnProperty("localCutoffTime")) { + properties._localCutoffTime = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify(message.localCutoffTime); + if (error) + return "localCutoffTime." + error; + } + } + if (message.storeCloseOffsetHours != null && message.hasOwnProperty("storeCloseOffsetHours")) { + properties._storeCloseOffsetHours = 1; + if (!$util.isInteger(message.storeCloseOffsetHours) && !(message.storeCloseOffsetHours && $util.isInteger(message.storeCloseOffsetHours.low) && $util.isInteger(message.storeCloseOffsetHours.high))) + return "storeCloseOffsetHours: integer|Long expected"; + } + if (message.noDeliveryPostCutoff != null && message.hasOwnProperty("noDeliveryPostCutoff")) { + properties._noDeliveryPostCutoff = 1; + if (typeof message.noDeliveryPostCutoff !== "boolean") + return "noDeliveryPostCutoff: boolean expected"; + } + return null; + }; + + /** + * Creates a CutoffConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig} CutoffConfig + */ + CutoffConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig(); + if (object.localCutoffTime != null) { + if (typeof object.localCutoffTime !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.localCutoffTime: object expected"); + message.localCutoffTime = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.fromObject(object.localCutoffTime); + } + if (object.storeCloseOffsetHours != null) + if ($util.Long) + (message.storeCloseOffsetHours = $util.Long.fromValue(object.storeCloseOffsetHours)).unsigned = false; + else if (typeof object.storeCloseOffsetHours === "string") + message.storeCloseOffsetHours = parseInt(object.storeCloseOffsetHours, 10); + else if (typeof object.storeCloseOffsetHours === "number") + message.storeCloseOffsetHours = object.storeCloseOffsetHours; + else if (typeof object.storeCloseOffsetHours === "object") + message.storeCloseOffsetHours = new $util.LongBits(object.storeCloseOffsetHours.low >>> 0, object.storeCloseOffsetHours.high >>> 0).toNumber(); + if (object.noDeliveryPostCutoff != null) + message.noDeliveryPostCutoff = Boolean(object.noDeliveryPostCutoff); + return message; + }; + + /** + * Creates a plain object from a CutoffConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig} message CutoffConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CutoffConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.localCutoffTime != null && message.hasOwnProperty("localCutoffTime")) { + object.localCutoffTime = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.toObject(message.localCutoffTime, options); + if (options.oneofs) + object._localCutoffTime = "localCutoffTime"; + } + if (message.storeCloseOffsetHours != null && message.hasOwnProperty("storeCloseOffsetHours")) { + if (typeof message.storeCloseOffsetHours === "number") + object.storeCloseOffsetHours = options.longs === String ? String(message.storeCloseOffsetHours) : message.storeCloseOffsetHours; + else + object.storeCloseOffsetHours = options.longs === String ? $util.Long.prototype.toString.call(message.storeCloseOffsetHours) : options.longs === Number ? new $util.LongBits(message.storeCloseOffsetHours.low >>> 0, message.storeCloseOffsetHours.high >>> 0).toNumber() : message.storeCloseOffsetHours; + if (options.oneofs) + object._storeCloseOffsetHours = "storeCloseOffsetHours"; + } + if (message.noDeliveryPostCutoff != null && message.hasOwnProperty("noDeliveryPostCutoff")) { + object.noDeliveryPostCutoff = message.noDeliveryPostCutoff; + if (options.oneofs) + object._noDeliveryPostCutoff = "noDeliveryPostCutoff"; + } + return object; + }; + + /** + * Converts this CutoffConfig to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @instance + * @returns {Object.} JSON object + */ + CutoffConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CutoffConfig + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CutoffConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig"; + }; + + CutoffConfig.LocalCutoffTime = (function() { + + /** + * Properties of a LocalCutoffTime. + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @interface ILocalCutoffTime + * @property {number|Long|null} [hour] LocalCutoffTime hour + * @property {number|Long|null} [minute] LocalCutoffTime minute + */ + + /** + * Constructs a new LocalCutoffTime. + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig + * @classdesc Represents a LocalCutoffTime. + * @implements ILocalCutoffTime + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime=} [properties] Properties to set + */ + function LocalCutoffTime(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]]; + } + + /** + * LocalCutoffTime hour. + * @member {number|Long|null|undefined} hour + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @instance + */ + LocalCutoffTime.prototype.hour = null; + + /** + * LocalCutoffTime minute. + * @member {number|Long|null|undefined} minute + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @instance + */ + LocalCutoffTime.prototype.minute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LocalCutoffTime _hour. + * @member {"hour"|undefined} _hour + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @instance + */ + Object.defineProperty(LocalCutoffTime.prototype, "_hour", { + get: $util.oneOfGetter($oneOfFields = ["hour"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LocalCutoffTime _minute. + * @member {"minute"|undefined} _minute + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @instance + */ + Object.defineProperty(LocalCutoffTime.prototype, "_minute", { + get: $util.oneOfGetter($oneOfFields = ["minute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LocalCutoffTime instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime} LocalCutoffTime instance + */ + LocalCutoffTime.create = function create(properties) { + return new LocalCutoffTime(properties); + }; + + /** + * Encodes the specified LocalCutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime} message LocalCutoffTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalCutoffTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.hour); + if (message.minute != null && Object.hasOwnProperty.call(message, "minute")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minute); + return writer; + }; + + /** + * Encodes the specified LocalCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime} message LocalCutoffTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalCutoffTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalCutoffTime message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @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.Service.StoreConfig.CutoffConfig.LocalCutoffTime} LocalCutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalCutoffTime.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.Service.StoreConfig.CutoffConfig.LocalCutoffTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hour = reader.int64(); + break; + } + case 2: { + message.minute = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalCutoffTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime} LocalCutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalCutoffTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalCutoffTime message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalCutoffTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hour != null && message.hasOwnProperty("hour")) { + properties._hour = 1; + if (!$util.isInteger(message.hour) && !(message.hour && $util.isInteger(message.hour.low) && $util.isInteger(message.hour.high))) + return "hour: integer|Long expected"; + } + if (message.minute != null && message.hasOwnProperty("minute")) { + properties._minute = 1; + if (!$util.isInteger(message.minute) && !(message.minute && $util.isInteger(message.minute.low) && $util.isInteger(message.minute.high))) + return "minute: integer|Long expected"; + } + return null; + }; + + /** + * Creates a LocalCutoffTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime} LocalCutoffTime + */ + LocalCutoffTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime(); + if (object.hour != null) + if ($util.Long) + (message.hour = $util.Long.fromValue(object.hour)).unsigned = false; + else if (typeof object.hour === "string") + message.hour = parseInt(object.hour, 10); + else if (typeof object.hour === "number") + message.hour = object.hour; + else if (typeof object.hour === "object") + message.hour = new $util.LongBits(object.hour.low >>> 0, object.hour.high >>> 0).toNumber(); + if (object.minute != null) + if ($util.Long) + (message.minute = $util.Long.fromValue(object.minute)).unsigned = false; + else if (typeof object.minute === "string") + message.minute = parseInt(object.minute, 10); + else if (typeof object.minute === "number") + message.minute = object.minute; + else if (typeof object.minute === "object") + message.minute = new $util.LongBits(object.minute.low >>> 0, object.minute.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a LocalCutoffTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime} message LocalCutoffTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalCutoffTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.hour != null && message.hasOwnProperty("hour")) { + if (typeof message.hour === "number") + object.hour = options.longs === String ? String(message.hour) : message.hour; + else + object.hour = options.longs === String ? $util.Long.prototype.toString.call(message.hour) : options.longs === Number ? new $util.LongBits(message.hour.low >>> 0, message.hour.high >>> 0).toNumber() : message.hour; + if (options.oneofs) + object._hour = "hour"; + } + if (message.minute != null && message.hasOwnProperty("minute")) { + if (typeof message.minute === "number") + object.minute = options.longs === String ? String(message.minute) : message.minute; + else + object.minute = options.longs === String ? $util.Long.prototype.toString.call(message.minute) : options.longs === Number ? new $util.LongBits(message.minute.low >>> 0, message.minute.high >>> 0).toNumber() : message.minute; + if (options.oneofs) + object._minute = "minute"; + } + return object; + }; + + /** + * Converts this LocalCutoffTime to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @instance + * @returns {Object.} JSON object + */ + LocalCutoffTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocalCutoffTime + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocalCutoffTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime"; + }; + + return LocalCutoffTime; + })(); + + return CutoffConfig; + })(); + + /** + * StoreServiceType enum. + * @name google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType + * @enum {number} + * @property {number} STORE_SERVICE_TYPE_UNSPECIFIED=0 STORE_SERVICE_TYPE_UNSPECIFIED value + * @property {number} ALL_STORES=1 ALL_STORES value + * @property {number} SELECTED_STORES=2 SELECTED_STORES value + */ + StoreConfig.StoreServiceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STORE_SERVICE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALL_STORES"] = 1; + values[valuesById[2] = "SELECTED_STORES"] = 2; + return values; + })(); + + return StoreConfig; + })(); + + Service.LoyaltyProgram = (function() { + + /** + * Properties of a LoyaltyProgram. + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @interface ILoyaltyProgram + * @property {string|null} [programLabel] LoyaltyProgram programLabel + * @property {Array.|null} [loyaltyProgramTiers] LoyaltyProgram loyaltyProgramTiers + */ + + /** + * Constructs a new LoyaltyProgram. + * @memberof google.shopping.merchant.accounts.v1beta.Service + * @classdesc Represents a LoyaltyProgram. + * @implements ILoyaltyProgram + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram=} [properties] Properties to set + */ + function LoyaltyProgram(properties) { + this.loyaltyProgramTiers = []; + 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]]; + } + + /** + * LoyaltyProgram programLabel. + * @member {string|null|undefined} programLabel + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @instance + */ + LoyaltyProgram.prototype.programLabel = null; + + /** + * LoyaltyProgram loyaltyProgramTiers. + * @member {Array.} loyaltyProgramTiers + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @instance + */ + LoyaltyProgram.prototype.loyaltyProgramTiers = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LoyaltyProgram _programLabel. + * @member {"programLabel"|undefined} _programLabel + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @instance + */ + Object.defineProperty(LoyaltyProgram.prototype, "_programLabel", { + get: $util.oneOfGetter($oneOfFields = ["programLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LoyaltyProgram instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram} LoyaltyProgram instance + */ + LoyaltyProgram.create = function create(properties) { + return new LoyaltyProgram(properties); + }; + + /** + * Encodes the specified LoyaltyProgram message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram} message LoyaltyProgram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoyaltyProgram.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.programLabel != null && Object.hasOwnProperty.call(message, "programLabel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.programLabel); + if (message.loyaltyProgramTiers != null && message.loyaltyProgramTiers.length) + for (var i = 0; i < message.loyaltyProgramTiers.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.encode(message.loyaltyProgramTiers[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LoyaltyProgram message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram} message LoyaltyProgram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoyaltyProgram.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoyaltyProgram message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @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.Service.LoyaltyProgram} LoyaltyProgram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoyaltyProgram.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.Service.LoyaltyProgram(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.programLabel = reader.string(); + break; + } + case 2: { + if (!(message.loyaltyProgramTiers && message.loyaltyProgramTiers.length)) + message.loyaltyProgramTiers = []; + message.loyaltyProgramTiers.push($root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoyaltyProgram message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram} LoyaltyProgram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoyaltyProgram.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoyaltyProgram message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoyaltyProgram.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.programLabel != null && message.hasOwnProperty("programLabel")) { + properties._programLabel = 1; + if (!$util.isString(message.programLabel)) + return "programLabel: string expected"; + } + if (message.loyaltyProgramTiers != null && message.hasOwnProperty("loyaltyProgramTiers")) { + if (!Array.isArray(message.loyaltyProgramTiers)) + return "loyaltyProgramTiers: array expected"; + for (var i = 0; i < message.loyaltyProgramTiers.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify(message.loyaltyProgramTiers[i]); + if (error) + return "loyaltyProgramTiers." + error; + } + } + return null; + }; + + /** + * Creates a LoyaltyProgram message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram} LoyaltyProgram + */ + LoyaltyProgram.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram(); + if (object.programLabel != null) + message.programLabel = String(object.programLabel); + if (object.loyaltyProgramTiers) { + if (!Array.isArray(object.loyaltyProgramTiers)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.loyaltyProgramTiers: array expected"); + message.loyaltyProgramTiers = []; + for (var i = 0; i < object.loyaltyProgramTiers.length; ++i) { + if (typeof object.loyaltyProgramTiers[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.loyaltyProgramTiers: object expected"); + message.loyaltyProgramTiers[i] = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.fromObject(object.loyaltyProgramTiers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LoyaltyProgram message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram} message LoyaltyProgram + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoyaltyProgram.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.loyaltyProgramTiers = []; + if (message.programLabel != null && message.hasOwnProperty("programLabel")) { + object.programLabel = message.programLabel; + if (options.oneofs) + object._programLabel = "programLabel"; + } + if (message.loyaltyProgramTiers && message.loyaltyProgramTiers.length) { + object.loyaltyProgramTiers = []; + for (var j = 0; j < message.loyaltyProgramTiers.length; ++j) + object.loyaltyProgramTiers[j] = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.toObject(message.loyaltyProgramTiers[j], options); + } + return object; + }; + + /** + * Converts this LoyaltyProgram to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @instance + * @returns {Object.} JSON object + */ + LoyaltyProgram.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoyaltyProgram + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoyaltyProgram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram"; + }; + + LoyaltyProgram.LoyaltyProgramTiers = (function() { + + /** + * Properties of a LoyaltyProgramTiers. + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @interface ILoyaltyProgramTiers + * @property {string|null} [tierLabel] LoyaltyProgramTiers tierLabel + */ + + /** + * Constructs a new LoyaltyProgramTiers. + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram + * @classdesc Represents a LoyaltyProgramTiers. + * @implements ILoyaltyProgramTiers + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers=} [properties] Properties to set + */ + function LoyaltyProgramTiers(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]]; + } + + /** + * LoyaltyProgramTiers tierLabel. + * @member {string|null|undefined} tierLabel + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @instance + */ + LoyaltyProgramTiers.prototype.tierLabel = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LoyaltyProgramTiers _tierLabel. + * @member {"tierLabel"|undefined} _tierLabel + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @instance + */ + Object.defineProperty(LoyaltyProgramTiers.prototype, "_tierLabel", { + get: $util.oneOfGetter($oneOfFields = ["tierLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LoyaltyProgramTiers instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers} LoyaltyProgramTiers instance + */ + LoyaltyProgramTiers.create = function create(properties) { + return new LoyaltyProgramTiers(properties); + }; + + /** + * Encodes the specified LoyaltyProgramTiers message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers} message LoyaltyProgramTiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoyaltyProgramTiers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tierLabel != null && Object.hasOwnProperty.call(message, "tierLabel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tierLabel); + return writer; + }; + + /** + * Encodes the specified LoyaltyProgramTiers message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers} message LoyaltyProgramTiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoyaltyProgramTiers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoyaltyProgramTiers message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @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.Service.LoyaltyProgram.LoyaltyProgramTiers} LoyaltyProgramTiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoyaltyProgramTiers.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.Service.LoyaltyProgram.LoyaltyProgramTiers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tierLabel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoyaltyProgramTiers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers} LoyaltyProgramTiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoyaltyProgramTiers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoyaltyProgramTiers message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoyaltyProgramTiers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tierLabel != null && message.hasOwnProperty("tierLabel")) { + properties._tierLabel = 1; + if (!$util.isString(message.tierLabel)) + return "tierLabel: string expected"; + } + return null; + }; + + /** + * Creates a LoyaltyProgramTiers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers} LoyaltyProgramTiers + */ + LoyaltyProgramTiers.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers(); + if (object.tierLabel != null) + message.tierLabel = String(object.tierLabel); + return message; + }; + + /** + * Creates a plain object from a LoyaltyProgramTiers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @static + * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers} message LoyaltyProgramTiers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoyaltyProgramTiers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tierLabel != null && message.hasOwnProperty("tierLabel")) { + object.tierLabel = message.tierLabel; + if (options.oneofs) + object._tierLabel = "tierLabel"; + } + return object; + }; + + /** + * Converts this LoyaltyProgramTiers to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @instance + * @returns {Object.} JSON object + */ + LoyaltyProgramTiers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoyaltyProgramTiers + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoyaltyProgramTiers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers"; + }; + + return LoyaltyProgramTiers; + })(); + + return LoyaltyProgram; + })(); + + /** + * ShipmentType enum. + * @name google.shopping.merchant.accounts.v1beta.Service.ShipmentType + * @enum {number} + * @property {number} SHIPMENT_TYPE_UNSPECIFIED=0 SHIPMENT_TYPE_UNSPECIFIED value + * @property {number} DELIVERY=1 DELIVERY value + * @property {number} LOCAL_DELIVERY=2 LOCAL_DELIVERY value + * @property {number} COLLECTION_POINT=3 COLLECTION_POINT value + */ + Service.ShipmentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHIPMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DELIVERY"] = 1; + values[valuesById[2] = "LOCAL_DELIVERY"] = 2; + values[valuesById[3] = "COLLECTION_POINT"] = 3; + return values; + })(); + + return Service; + })(); + + v1beta.Distance = (function() { + + /** + * Properties of a Distance. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IDistance + * @property {number|Long|null} [value] Distance value + * @property {google.shopping.merchant.accounts.v1beta.Distance.Unit|null} [unit] Distance unit + */ + + /** + * Constructs a new Distance. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Distance. + * @implements IDistance + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IDistance=} [properties] Properties to set + */ + function Distance(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]]; + } + + /** + * Distance value. + * @member {number|Long|null|undefined} value + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @instance + */ + Distance.prototype.value = null; + + /** + * Distance unit. + * @member {google.shopping.merchant.accounts.v1beta.Distance.Unit|null|undefined} unit + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @instance + */ + Distance.prototype.unit = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Distance _value. + * @member {"value"|undefined} _value + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @instance + */ + Object.defineProperty(Distance.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Distance _unit. + * @member {"unit"|undefined} _unit + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @instance + */ + Object.defineProperty(Distance.prototype, "_unit", { + get: $util.oneOfGetter($oneOfFields = ["unit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Distance instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDistance=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Distance} Distance instance + */ + Distance.create = function create(properties) { + return new Distance(properties); + }; + + /** + * Encodes the specified Distance message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Distance.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDistance} message Distance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Distance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unit); + return writer; + }; + + /** + * Encodes the specified Distance message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Distance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDistance} message Distance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Distance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Distance message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @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.Distance} Distance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Distance.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.Distance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + case 2: { + message.unit = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Distance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Distance} Distance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Distance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Distance message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Distance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + } + if (message.unit != null && message.hasOwnProperty("unit")) { + properties._unit = 1; + switch (message.unit) { + default: + return "unit: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a Distance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Distance} Distance + */ + Distance.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Distance) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Distance(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + switch (object.unit) { + default: + if (typeof object.unit === "number") { + message.unit = object.unit; + break; + } + break; + case "UNIT_UNSPECIFIED": + case 0: + message.unit = 0; + break; + case "MILES": + case 1: + message.unit = 1; + break; + case "KILOMETERS": + case 2: + message.unit = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Distance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @static + * @param {google.shopping.merchant.accounts.v1beta.Distance} message Distance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Distance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.value != null && message.hasOwnProperty("value")) { + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + if (options.oneofs) + object._value = "value"; + } + if (message.unit != null && message.hasOwnProperty("unit")) { + object.unit = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.Distance.Unit[message.unit] === undefined ? message.unit : $root.google.shopping.merchant.accounts.v1beta.Distance.Unit[message.unit] : message.unit; + if (options.oneofs) + object._unit = "unit"; + } + return object; + }; + + /** + * Converts this Distance to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @instance + * @returns {Object.} JSON object + */ + Distance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Distance + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Distance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Distance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Distance"; + }; + + /** + * Unit enum. + * @name google.shopping.merchant.accounts.v1beta.Distance.Unit + * @enum {number} + * @property {number} UNIT_UNSPECIFIED=0 UNIT_UNSPECIFIED value + * @property {number} MILES=1 MILES value + * @property {number} KILOMETERS=2 KILOMETERS value + */ + Distance.Unit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "MILES"] = 1; + values[valuesById[2] = "KILOMETERS"] = 2; + return values; + })(); + + return Distance; + })(); + + v1beta.Warehouse = (function() { + + /** + * Properties of a Warehouse. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IWarehouse + * @property {string|null} [name] Warehouse name + * @property {google.shopping.merchant.accounts.v1beta.IAddress|null} [shippingAddress] Warehouse shippingAddress + * @property {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime|null} [cutoffTime] Warehouse cutoffTime + * @property {number|Long|null} [handlingDays] Warehouse handlingDays + * @property {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null} [businessDayConfig] Warehouse businessDayConfig + */ + + /** + * Constructs a new Warehouse. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Warehouse. + * @implements IWarehouse + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IWarehouse=} [properties] Properties to set + */ + function Warehouse(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]]; + } + + /** + * Warehouse name. + * @member {string|null|undefined} name + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Warehouse.prototype.name = null; + + /** + * Warehouse shippingAddress. + * @member {google.shopping.merchant.accounts.v1beta.IAddress|null|undefined} shippingAddress + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Warehouse.prototype.shippingAddress = null; + + /** + * Warehouse cutoffTime. + * @member {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime|null|undefined} cutoffTime + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Warehouse.prototype.cutoffTime = null; + + /** + * Warehouse handlingDays. + * @member {number|Long|null|undefined} handlingDays + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Warehouse.prototype.handlingDays = null; + + /** + * Warehouse businessDayConfig. + * @member {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null|undefined} businessDayConfig + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Warehouse.prototype.businessDayConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Warehouse _name. + * @member {"name"|undefined} _name + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Object.defineProperty(Warehouse.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Warehouse _shippingAddress. + * @member {"shippingAddress"|undefined} _shippingAddress + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Object.defineProperty(Warehouse.prototype, "_shippingAddress", { + get: $util.oneOfGetter($oneOfFields = ["shippingAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Warehouse _cutoffTime. + * @member {"cutoffTime"|undefined} _cutoffTime + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Object.defineProperty(Warehouse.prototype, "_cutoffTime", { + get: $util.oneOfGetter($oneOfFields = ["cutoffTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Warehouse _handlingDays. + * @member {"handlingDays"|undefined} _handlingDays + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Object.defineProperty(Warehouse.prototype, "_handlingDays", { + get: $util.oneOfGetter($oneOfFields = ["handlingDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Warehouse _businessDayConfig. + * @member {"businessDayConfig"|undefined} _businessDayConfig + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + */ + Object.defineProperty(Warehouse.prototype, "_businessDayConfig", { + get: $util.oneOfGetter($oneOfFields = ["businessDayConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Warehouse instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IWarehouse=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Warehouse} Warehouse instance + */ + Warehouse.create = function create(properties) { + return new Warehouse(properties); + }; + + /** + * Encodes the specified Warehouse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Warehouse.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IWarehouse} message Warehouse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warehouse.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.shippingAddress != null && Object.hasOwnProperty.call(message, "shippingAddress")) + $root.google.shopping.merchant.accounts.v1beta.Address.encode(message.shippingAddress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cutoffTime != null && Object.hasOwnProperty.call(message, "cutoffTime")) + $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.encode(message.cutoffTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.handlingDays != null && Object.hasOwnProperty.call(message, "handlingDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.handlingDays); + if (message.businessDayConfig != null && Object.hasOwnProperty.call(message, "businessDayConfig")) + $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.encode(message.businessDayConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Warehouse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Warehouse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @static + * @param {google.shopping.merchant.accounts.v1beta.IWarehouse} message Warehouse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warehouse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Warehouse message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @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.Warehouse} Warehouse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warehouse.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.Warehouse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.shippingAddress = $root.google.shopping.merchant.accounts.v1beta.Address.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.decode(reader, reader.uint32()); + break; + } + case 4: { + message.handlingDays = reader.int64(); + break; + } + case 5: { + message.businessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Warehouse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Warehouse} Warehouse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warehouse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Warehouse message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Warehouse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.shippingAddress != null && message.hasOwnProperty("shippingAddress")) { + properties._shippingAddress = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Address.verify(message.shippingAddress); + if (error) + return "shippingAddress." + error; + } + } + if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { + properties._cutoffTime = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify(message.cutoffTime); + if (error) + return "cutoffTime." + error; + } + } + if (message.handlingDays != null && message.hasOwnProperty("handlingDays")) { + properties._handlingDays = 1; + if (!$util.isInteger(message.handlingDays) && !(message.handlingDays && $util.isInteger(message.handlingDays.low) && $util.isInteger(message.handlingDays.high))) + return "handlingDays: integer|Long expected"; + } + if (message.businessDayConfig != null && message.hasOwnProperty("businessDayConfig")) { + properties._businessDayConfig = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify(message.businessDayConfig); + if (error) + return "businessDayConfig." + error; + } + } + return null; + }; + + /** + * Creates a Warehouse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Warehouse} Warehouse + */ + Warehouse.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Warehouse) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Warehouse(); + if (object.name != null) + message.name = String(object.name); + if (object.shippingAddress != null) { + if (typeof object.shippingAddress !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Warehouse.shippingAddress: object expected"); + message.shippingAddress = $root.google.shopping.merchant.accounts.v1beta.Address.fromObject(object.shippingAddress); + } + if (object.cutoffTime != null) { + if (typeof object.cutoffTime !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Warehouse.cutoffTime: object expected"); + message.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.fromObject(object.cutoffTime); + } + if (object.handlingDays != null) + if ($util.Long) + (message.handlingDays = $util.Long.fromValue(object.handlingDays)).unsigned = false; + else if (typeof object.handlingDays === "string") + message.handlingDays = parseInt(object.handlingDays, 10); + else if (typeof object.handlingDays === "number") + message.handlingDays = object.handlingDays; + else if (typeof object.handlingDays === "object") + message.handlingDays = new $util.LongBits(object.handlingDays.low >>> 0, object.handlingDays.high >>> 0).toNumber(); + if (object.businessDayConfig != null) { + if (typeof object.businessDayConfig !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Warehouse.businessDayConfig: object expected"); + message.businessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.fromObject(object.businessDayConfig); + } + return message; + }; + + /** + * Creates a plain object from a Warehouse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @static + * @param {google.shopping.merchant.accounts.v1beta.Warehouse} message Warehouse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Warehouse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.shippingAddress != null && message.hasOwnProperty("shippingAddress")) { + object.shippingAddress = $root.google.shopping.merchant.accounts.v1beta.Address.toObject(message.shippingAddress, options); + if (options.oneofs) + object._shippingAddress = "shippingAddress"; + } + if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { + object.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.toObject(message.cutoffTime, options); + if (options.oneofs) + object._cutoffTime = "cutoffTime"; + } + if (message.handlingDays != null && message.hasOwnProperty("handlingDays")) { + if (typeof message.handlingDays === "number") + object.handlingDays = options.longs === String ? String(message.handlingDays) : message.handlingDays; + else + object.handlingDays = options.longs === String ? $util.Long.prototype.toString.call(message.handlingDays) : options.longs === Number ? new $util.LongBits(message.handlingDays.low >>> 0, message.handlingDays.high >>> 0).toNumber() : message.handlingDays; + if (options.oneofs) + object._handlingDays = "handlingDays"; + } + if (message.businessDayConfig != null && message.hasOwnProperty("businessDayConfig")) { + object.businessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.toObject(message.businessDayConfig, options); + if (options.oneofs) + object._businessDayConfig = "businessDayConfig"; + } + return object; + }; + + /** + * Converts this Warehouse to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @instance + * @returns {Object.} JSON object + */ + Warehouse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Warehouse + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Warehouse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Warehouse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Warehouse"; + }; + + return Warehouse; + })(); + + v1beta.WarehouseCutoffTime = (function() { + + /** + * Properties of a WarehouseCutoffTime. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IWarehouseCutoffTime + * @property {number|null} [hour] WarehouseCutoffTime hour + * @property {number|null} [minute] WarehouseCutoffTime minute + */ + + /** + * Constructs a new WarehouseCutoffTime. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a WarehouseCutoffTime. + * @implements IWarehouseCutoffTime + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime=} [properties] Properties to set + */ + function WarehouseCutoffTime(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]]; + } + + /** + * WarehouseCutoffTime hour. + * @member {number|null|undefined} hour + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @instance + */ + WarehouseCutoffTime.prototype.hour = null; + + /** + * WarehouseCutoffTime minute. + * @member {number|null|undefined} minute + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @instance + */ + WarehouseCutoffTime.prototype.minute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WarehouseCutoffTime _hour. + * @member {"hour"|undefined} _hour + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @instance + */ + Object.defineProperty(WarehouseCutoffTime.prototype, "_hour", { + get: $util.oneOfGetter($oneOfFields = ["hour"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * WarehouseCutoffTime _minute. + * @member {"minute"|undefined} _minute + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @instance + */ + Object.defineProperty(WarehouseCutoffTime.prototype, "_minute", { + get: $util.oneOfGetter($oneOfFields = ["minute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WarehouseCutoffTime instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime} WarehouseCutoffTime instance + */ + WarehouseCutoffTime.create = function create(properties) { + return new WarehouseCutoffTime(properties); + }; + + /** + * Encodes the specified WarehouseCutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime} message WarehouseCutoffTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WarehouseCutoffTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hour); + if (message.minute != null && Object.hasOwnProperty.call(message, "minute")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minute); + return writer; + }; + + /** + * Encodes the specified WarehouseCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime} message WarehouseCutoffTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WarehouseCutoffTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WarehouseCutoffTime message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @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.WarehouseCutoffTime} WarehouseCutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WarehouseCutoffTime.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.WarehouseCutoffTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hour = reader.int32(); + break; + } + case 2: { + message.minute = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WarehouseCutoffTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime} WarehouseCutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WarehouseCutoffTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WarehouseCutoffTime message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WarehouseCutoffTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hour != null && message.hasOwnProperty("hour")) { + properties._hour = 1; + if (!$util.isInteger(message.hour)) + return "hour: integer expected"; + } + if (message.minute != null && message.hasOwnProperty("minute")) { + properties._minute = 1; + if (!$util.isInteger(message.minute)) + return "minute: integer expected"; + } + return null; + }; + + /** + * Creates a WarehouseCutoffTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime} WarehouseCutoffTime + */ + WarehouseCutoffTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime(); + if (object.hour != null) + message.hour = object.hour | 0; + if (object.minute != null) + message.minute = object.minute | 0; + return message; + }; + + /** + * Creates a plain object from a WarehouseCutoffTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime} message WarehouseCutoffTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WarehouseCutoffTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.hour != null && message.hasOwnProperty("hour")) { + object.hour = message.hour; + if (options.oneofs) + object._hour = "hour"; + } + if (message.minute != null && message.hasOwnProperty("minute")) { + object.minute = message.minute; + if (options.oneofs) + object._minute = "minute"; + } + return object; + }; + + /** + * Converts this WarehouseCutoffTime to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @instance + * @returns {Object.} JSON object + */ + WarehouseCutoffTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WarehouseCutoffTime + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WarehouseCutoffTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime"; + }; + + return WarehouseCutoffTime; + })(); + + v1beta.Address = (function() { + + /** + * Properties of an Address. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IAddress + * @property {string|null} [streetAddress] Address streetAddress + * @property {string|null} [city] Address city + * @property {string|null} [administrativeArea] Address administrativeArea + * @property {string|null} [postalCode] Address postalCode + * @property {string|null} [regionCode] Address regionCode + */ + + /** + * Constructs a new Address. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an Address. + * @implements IAddress + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IAddress=} [properties] Properties to set + */ + function Address(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]]; + } + + /** + * Address streetAddress. + * @member {string|null|undefined} streetAddress + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Address.prototype.streetAddress = null; + + /** + * Address city. + * @member {string|null|undefined} city + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Address.prototype.city = null; + + /** + * Address administrativeArea. + * @member {string|null|undefined} administrativeArea + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Address.prototype.administrativeArea = null; + + /** + * Address postalCode. + * @member {string|null|undefined} postalCode + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Address.prototype.postalCode = null; + + /** + * Address regionCode. + * @member {string|null|undefined} regionCode + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Address.prototype.regionCode = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Address _streetAddress. + * @member {"streetAddress"|undefined} _streetAddress + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_streetAddress", { + get: $util.oneOfGetter($oneOfFields = ["streetAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _city. + * @member {"city"|undefined} _city + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_city", { + get: $util.oneOfGetter($oneOfFields = ["city"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _administrativeArea. + * @member {"administrativeArea"|undefined} _administrativeArea + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_administrativeArea", { + get: $util.oneOfGetter($oneOfFields = ["administrativeArea"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _postalCode. + * @member {"postalCode"|undefined} _postalCode + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_postalCode", { + get: $util.oneOfGetter($oneOfFields = ["postalCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _regionCode. + * @member {"regionCode"|undefined} _regionCode + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_regionCode", { + get: $util.oneOfGetter($oneOfFields = ["regionCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Address instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAddress=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Address} Address instance + */ + Address.create = function create(properties) { + return new Address(properties); + }; + + /** + * Encodes the specified Address message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Address.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAddress} message Address message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Address.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streetAddress != null && Object.hasOwnProperty.call(message, "streetAddress")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.streetAddress); + if (message.city != null && Object.hasOwnProperty.call(message, "city")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.city); + if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.administrativeArea); + if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCode); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.regionCode); + return writer; + }; + + /** + * Encodes the specified Address message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Address.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAddress} message Address message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Address.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Address message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @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.Address} Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Address.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.Address(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.streetAddress = reader.string(); + break; + } + case 2: { + message.city = reader.string(); + break; + } + case 3: { + message.administrativeArea = reader.string(); + break; + } + case 4: { + message.postalCode = reader.string(); + break; + } + case 5: { + message.regionCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Address message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Address} Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Address.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Address message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Address.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) { + properties._streetAddress = 1; + if (!$util.isString(message.streetAddress)) + return "streetAddress: string expected"; + } + if (message.city != null && message.hasOwnProperty("city")) { + properties._city = 1; + if (!$util.isString(message.city)) + return "city: string expected"; + } + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) { + properties._administrativeArea = 1; + if (!$util.isString(message.administrativeArea)) + return "administrativeArea: string expected"; + } + if (message.postalCode != null && message.hasOwnProperty("postalCode")) { + properties._postalCode = 1; + if (!$util.isString(message.postalCode)) + return "postalCode: string expected"; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) { + properties._regionCode = 1; + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + } + return null; + }; + + /** + * Creates an Address message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Address} Address + */ + Address.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Address) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Address(); + if (object.streetAddress != null) + message.streetAddress = String(object.streetAddress); + if (object.city != null) + message.city = String(object.city); + if (object.administrativeArea != null) + message.administrativeArea = String(object.administrativeArea); + if (object.postalCode != null) + message.postalCode = String(object.postalCode); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + return message; + }; + + /** + * Creates a plain object from an Address message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @static + * @param {google.shopping.merchant.accounts.v1beta.Address} message Address + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Address.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) { + object.streetAddress = message.streetAddress; + if (options.oneofs) + object._streetAddress = "streetAddress"; + } + if (message.city != null && message.hasOwnProperty("city")) { + object.city = message.city; + if (options.oneofs) + object._city = "city"; + } + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) { + object.administrativeArea = message.administrativeArea; + if (options.oneofs) + object._administrativeArea = "administrativeArea"; + } + if (message.postalCode != null && message.hasOwnProperty("postalCode")) { + object.postalCode = message.postalCode; + if (options.oneofs) + object._postalCode = "postalCode"; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) { + object.regionCode = message.regionCode; + if (options.oneofs) + object._regionCode = "regionCode"; + } + return object; + }; + + /** + * Converts this Address to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @instance + * @returns {Object.} JSON object + */ + Address.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Address + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Address + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Address.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Address"; + }; + + return Address; + })(); + + v1beta.DeliveryTime = (function() { + + /** + * Properties of a DeliveryTime. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IDeliveryTime + * @property {number|null} [minTransitDays] DeliveryTime minTransitDays + * @property {number|null} [maxTransitDays] DeliveryTime maxTransitDays + * @property {google.shopping.merchant.accounts.v1beta.ICutoffTime|null} [cutoffTime] DeliveryTime cutoffTime + * @property {number|null} [minHandlingDays] DeliveryTime minHandlingDays + * @property {number|null} [maxHandlingDays] DeliveryTime maxHandlingDays + * @property {google.shopping.merchant.accounts.v1beta.ITransitTable|null} [transitTimeTable] DeliveryTime transitTimeTable + * @property {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null} [handlingBusinessDayConfig] DeliveryTime handlingBusinessDayConfig + * @property {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null} [transitBusinessDayConfig] DeliveryTime transitBusinessDayConfig + * @property {Array.|null} [warehouseBasedDeliveryTimes] DeliveryTime warehouseBasedDeliveryTimes + */ + + /** + * Constructs a new DeliveryTime. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a DeliveryTime. + * @implements IDeliveryTime + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IDeliveryTime=} [properties] Properties to set + */ + function DeliveryTime(properties) { + this.warehouseBasedDeliveryTimes = []; + 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]]; + } + + /** + * DeliveryTime minTransitDays. + * @member {number|null|undefined} minTransitDays + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + DeliveryTime.prototype.minTransitDays = null; + + /** + * DeliveryTime maxTransitDays. + * @member {number|null|undefined} maxTransitDays + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + DeliveryTime.prototype.maxTransitDays = null; + + /** + * DeliveryTime cutoffTime. + * @member {google.shopping.merchant.accounts.v1beta.ICutoffTime|null|undefined} cutoffTime + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + DeliveryTime.prototype.cutoffTime = null; + + /** + * DeliveryTime minHandlingDays. + * @member {number|null|undefined} minHandlingDays + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + DeliveryTime.prototype.minHandlingDays = null; + + /** + * DeliveryTime maxHandlingDays. + * @member {number|null|undefined} maxHandlingDays + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + DeliveryTime.prototype.maxHandlingDays = null; + + /** + * DeliveryTime transitTimeTable. + * @member {google.shopping.merchant.accounts.v1beta.ITransitTable|null|undefined} transitTimeTable + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + DeliveryTime.prototype.transitTimeTable = null; + + /** + * DeliveryTime handlingBusinessDayConfig. + * @member {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null|undefined} handlingBusinessDayConfig + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + DeliveryTime.prototype.handlingBusinessDayConfig = null; + + /** + * DeliveryTime transitBusinessDayConfig. + * @member {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null|undefined} transitBusinessDayConfig + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + DeliveryTime.prototype.transitBusinessDayConfig = null; + + /** + * DeliveryTime warehouseBasedDeliveryTimes. + * @member {Array.} warehouseBasedDeliveryTimes + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + DeliveryTime.prototype.warehouseBasedDeliveryTimes = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeliveryTime _minTransitDays. + * @member {"minTransitDays"|undefined} _minTransitDays + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + Object.defineProperty(DeliveryTime.prototype, "_minTransitDays", { + get: $util.oneOfGetter($oneOfFields = ["minTransitDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeliveryTime _maxTransitDays. + * @member {"maxTransitDays"|undefined} _maxTransitDays + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + Object.defineProperty(DeliveryTime.prototype, "_maxTransitDays", { + get: $util.oneOfGetter($oneOfFields = ["maxTransitDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeliveryTime _cutoffTime. + * @member {"cutoffTime"|undefined} _cutoffTime + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + Object.defineProperty(DeliveryTime.prototype, "_cutoffTime", { + get: $util.oneOfGetter($oneOfFields = ["cutoffTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeliveryTime _minHandlingDays. + * @member {"minHandlingDays"|undefined} _minHandlingDays + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + Object.defineProperty(DeliveryTime.prototype, "_minHandlingDays", { + get: $util.oneOfGetter($oneOfFields = ["minHandlingDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeliveryTime _maxHandlingDays. + * @member {"maxHandlingDays"|undefined} _maxHandlingDays + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + Object.defineProperty(DeliveryTime.prototype, "_maxHandlingDays", { + get: $util.oneOfGetter($oneOfFields = ["maxHandlingDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeliveryTime _transitTimeTable. + * @member {"transitTimeTable"|undefined} _transitTimeTable + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + Object.defineProperty(DeliveryTime.prototype, "_transitTimeTable", { + get: $util.oneOfGetter($oneOfFields = ["transitTimeTable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeliveryTime _handlingBusinessDayConfig. + * @member {"handlingBusinessDayConfig"|undefined} _handlingBusinessDayConfig + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + Object.defineProperty(DeliveryTime.prototype, "_handlingBusinessDayConfig", { + get: $util.oneOfGetter($oneOfFields = ["handlingBusinessDayConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeliveryTime _transitBusinessDayConfig. + * @member {"transitBusinessDayConfig"|undefined} _transitBusinessDayConfig + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + */ + Object.defineProperty(DeliveryTime.prototype, "_transitBusinessDayConfig", { + get: $util.oneOfGetter($oneOfFields = ["transitBusinessDayConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeliveryTime instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeliveryTime=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.DeliveryTime} DeliveryTime instance + */ + DeliveryTime.create = function create(properties) { + return new DeliveryTime(properties); + }; + + /** + * Encodes the specified DeliveryTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeliveryTime.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeliveryTime} message DeliveryTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minTransitDays != null && Object.hasOwnProperty.call(message, "minTransitDays")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minTransitDays); + if (message.maxTransitDays != null && Object.hasOwnProperty.call(message, "maxTransitDays")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxTransitDays); + if (message.cutoffTime != null && Object.hasOwnProperty.call(message, "cutoffTime")) + $root.google.shopping.merchant.accounts.v1beta.CutoffTime.encode(message.cutoffTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.minHandlingDays != null && Object.hasOwnProperty.call(message, "minHandlingDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minHandlingDays); + if (message.maxHandlingDays != null && Object.hasOwnProperty.call(message, "maxHandlingDays")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxHandlingDays); + if (message.transitTimeTable != null && Object.hasOwnProperty.call(message, "transitTimeTable")) + $root.google.shopping.merchant.accounts.v1beta.TransitTable.encode(message.transitTimeTable, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.handlingBusinessDayConfig != null && Object.hasOwnProperty.call(message, "handlingBusinessDayConfig")) + $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.encode(message.handlingBusinessDayConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.transitBusinessDayConfig != null && Object.hasOwnProperty.call(message, "transitBusinessDayConfig")) + $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.encode(message.transitBusinessDayConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.warehouseBasedDeliveryTimes != null && message.warehouseBasedDeliveryTimes.length) + for (var i = 0; i < message.warehouseBasedDeliveryTimes.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.encode(message.warehouseBasedDeliveryTimes[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeliveryTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeliveryTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.IDeliveryTime} message DeliveryTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeliveryTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeliveryTime message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @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.DeliveryTime} DeliveryTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryTime.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.DeliveryTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minTransitDays = reader.int32(); + break; + } + case 2: { + message.maxTransitDays = reader.int32(); + break; + } + case 3: { + message.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.CutoffTime.decode(reader, reader.uint32()); + break; + } + case 4: { + message.minHandlingDays = reader.int32(); + break; + } + case 5: { + message.maxHandlingDays = reader.int32(); + break; + } + case 6: { + message.transitTimeTable = $root.google.shopping.merchant.accounts.v1beta.TransitTable.decode(reader, reader.uint32()); + break; + } + case 7: { + message.handlingBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.transitBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.warehouseBasedDeliveryTimes && message.warehouseBasedDeliveryTimes.length)) + message.warehouseBasedDeliveryTimes = []; + message.warehouseBasedDeliveryTimes.push($root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeliveryTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.DeliveryTime} DeliveryTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeliveryTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeliveryTime message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeliveryTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.minTransitDays != null && message.hasOwnProperty("minTransitDays")) { + properties._minTransitDays = 1; + if (!$util.isInteger(message.minTransitDays)) + return "minTransitDays: integer expected"; + } + if (message.maxTransitDays != null && message.hasOwnProperty("maxTransitDays")) { + properties._maxTransitDays = 1; + if (!$util.isInteger(message.maxTransitDays)) + return "maxTransitDays: integer expected"; + } + if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { + properties._cutoffTime = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.CutoffTime.verify(message.cutoffTime); + if (error) + return "cutoffTime." + error; + } + } + if (message.minHandlingDays != null && message.hasOwnProperty("minHandlingDays")) { + properties._minHandlingDays = 1; + if (!$util.isInteger(message.minHandlingDays)) + return "minHandlingDays: integer expected"; + } + if (message.maxHandlingDays != null && message.hasOwnProperty("maxHandlingDays")) { + properties._maxHandlingDays = 1; + if (!$util.isInteger(message.maxHandlingDays)) + return "maxHandlingDays: integer expected"; + } + if (message.transitTimeTable != null && message.hasOwnProperty("transitTimeTable")) { + properties._transitTimeTable = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.TransitTable.verify(message.transitTimeTable); + if (error) + return "transitTimeTable." + error; + } + } + if (message.handlingBusinessDayConfig != null && message.hasOwnProperty("handlingBusinessDayConfig")) { + properties._handlingBusinessDayConfig = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify(message.handlingBusinessDayConfig); + if (error) + return "handlingBusinessDayConfig." + error; + } + } + if (message.transitBusinessDayConfig != null && message.hasOwnProperty("transitBusinessDayConfig")) { + properties._transitBusinessDayConfig = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify(message.transitBusinessDayConfig); + if (error) + return "transitBusinessDayConfig." + error; + } + } + if (message.warehouseBasedDeliveryTimes != null && message.hasOwnProperty("warehouseBasedDeliveryTimes")) { + if (!Array.isArray(message.warehouseBasedDeliveryTimes)) + return "warehouseBasedDeliveryTimes: array expected"; + for (var i = 0; i < message.warehouseBasedDeliveryTimes.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify(message.warehouseBasedDeliveryTimes[i]); + if (error) + return "warehouseBasedDeliveryTimes." + error; + } + } + return null; + }; + + /** + * Creates a DeliveryTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.DeliveryTime} DeliveryTime + */ + DeliveryTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DeliveryTime) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.DeliveryTime(); + if (object.minTransitDays != null) + message.minTransitDays = object.minTransitDays | 0; + if (object.maxTransitDays != null) + message.maxTransitDays = object.maxTransitDays | 0; + if (object.cutoffTime != null) { + if (typeof object.cutoffTime !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.cutoffTime: object expected"); + message.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.CutoffTime.fromObject(object.cutoffTime); + } + if (object.minHandlingDays != null) + message.minHandlingDays = object.minHandlingDays | 0; + if (object.maxHandlingDays != null) + message.maxHandlingDays = object.maxHandlingDays | 0; + if (object.transitTimeTable != null) { + if (typeof object.transitTimeTable !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.transitTimeTable: object expected"); + message.transitTimeTable = $root.google.shopping.merchant.accounts.v1beta.TransitTable.fromObject(object.transitTimeTable); + } + if (object.handlingBusinessDayConfig != null) { + if (typeof object.handlingBusinessDayConfig !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.handlingBusinessDayConfig: object expected"); + message.handlingBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.fromObject(object.handlingBusinessDayConfig); + } + if (object.transitBusinessDayConfig != null) { + if (typeof object.transitBusinessDayConfig !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.transitBusinessDayConfig: object expected"); + message.transitBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.fromObject(object.transitBusinessDayConfig); + } + if (object.warehouseBasedDeliveryTimes) { + if (!Array.isArray(object.warehouseBasedDeliveryTimes)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.warehouseBasedDeliveryTimes: array expected"); + message.warehouseBasedDeliveryTimes = []; + for (var i = 0; i < object.warehouseBasedDeliveryTimes.length; ++i) { + if (typeof object.warehouseBasedDeliveryTimes[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.warehouseBasedDeliveryTimes: object expected"); + message.warehouseBasedDeliveryTimes[i] = $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.fromObject(object.warehouseBasedDeliveryTimes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DeliveryTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.DeliveryTime} message DeliveryTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeliveryTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warehouseBasedDeliveryTimes = []; + if (message.minTransitDays != null && message.hasOwnProperty("minTransitDays")) { + object.minTransitDays = message.minTransitDays; + if (options.oneofs) + object._minTransitDays = "minTransitDays"; + } + if (message.maxTransitDays != null && message.hasOwnProperty("maxTransitDays")) { + object.maxTransitDays = message.maxTransitDays; + if (options.oneofs) + object._maxTransitDays = "maxTransitDays"; + } + if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { + object.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.CutoffTime.toObject(message.cutoffTime, options); + if (options.oneofs) + object._cutoffTime = "cutoffTime"; + } + if (message.minHandlingDays != null && message.hasOwnProperty("minHandlingDays")) { + object.minHandlingDays = message.minHandlingDays; + if (options.oneofs) + object._minHandlingDays = "minHandlingDays"; + } + if (message.maxHandlingDays != null && message.hasOwnProperty("maxHandlingDays")) { + object.maxHandlingDays = message.maxHandlingDays; + if (options.oneofs) + object._maxHandlingDays = "maxHandlingDays"; + } + if (message.transitTimeTable != null && message.hasOwnProperty("transitTimeTable")) { + object.transitTimeTable = $root.google.shopping.merchant.accounts.v1beta.TransitTable.toObject(message.transitTimeTable, options); + if (options.oneofs) + object._transitTimeTable = "transitTimeTable"; + } + if (message.handlingBusinessDayConfig != null && message.hasOwnProperty("handlingBusinessDayConfig")) { + object.handlingBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.toObject(message.handlingBusinessDayConfig, options); + if (options.oneofs) + object._handlingBusinessDayConfig = "handlingBusinessDayConfig"; + } + if (message.transitBusinessDayConfig != null && message.hasOwnProperty("transitBusinessDayConfig")) { + object.transitBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.toObject(message.transitBusinessDayConfig, options); + if (options.oneofs) + object._transitBusinessDayConfig = "transitBusinessDayConfig"; + } + if (message.warehouseBasedDeliveryTimes && message.warehouseBasedDeliveryTimes.length) { + object.warehouseBasedDeliveryTimes = []; + for (var j = 0; j < message.warehouseBasedDeliveryTimes.length; ++j) + object.warehouseBasedDeliveryTimes[j] = $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.toObject(message.warehouseBasedDeliveryTimes[j], options); + } + return object; + }; + + /** + * Converts this DeliveryTime to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @instance + * @returns {Object.} JSON object + */ + DeliveryTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeliveryTime + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeliveryTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DeliveryTime"; + }; + + return DeliveryTime; + })(); + + v1beta.CutoffTime = (function() { + + /** + * Properties of a CutoffTime. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ICutoffTime + * @property {number|null} [hour] CutoffTime hour + * @property {number|null} [minute] CutoffTime minute + * @property {string|null} [timeZone] CutoffTime timeZone + */ + + /** + * Constructs a new CutoffTime. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a CutoffTime. + * @implements ICutoffTime + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ICutoffTime=} [properties] Properties to set + */ + function CutoffTime(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]]; + } + + /** + * CutoffTime hour. + * @member {number|null|undefined} hour + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @instance + */ + CutoffTime.prototype.hour = null; + + /** + * CutoffTime minute. + * @member {number|null|undefined} minute + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @instance + */ + CutoffTime.prototype.minute = null; + + /** + * CutoffTime timeZone. + * @member {string|null|undefined} timeZone + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @instance + */ + CutoffTime.prototype.timeZone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CutoffTime _hour. + * @member {"hour"|undefined} _hour + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @instance + */ + Object.defineProperty(CutoffTime.prototype, "_hour", { + get: $util.oneOfGetter($oneOfFields = ["hour"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CutoffTime _minute. + * @member {"minute"|undefined} _minute + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @instance + */ + Object.defineProperty(CutoffTime.prototype, "_minute", { + get: $util.oneOfGetter($oneOfFields = ["minute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CutoffTime _timeZone. + * @member {"timeZone"|undefined} _timeZone + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @instance + */ + Object.defineProperty(CutoffTime.prototype, "_timeZone", { + get: $util.oneOfGetter($oneOfFields = ["timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CutoffTime instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICutoffTime=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.CutoffTime} CutoffTime instance + */ + CutoffTime.create = function create(properties) { + return new CutoffTime(properties); + }; + + /** + * Encodes the specified CutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CutoffTime.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICutoffTime} message CutoffTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CutoffTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hour); + if (message.minute != null && Object.hasOwnProperty.call(message, "minute")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minute); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeZone); + return writer; + }; + + /** + * Encodes the specified CutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CutoffTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICutoffTime} message CutoffTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CutoffTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CutoffTime message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @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.CutoffTime} CutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CutoffTime.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.CutoffTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hour = reader.int32(); + break; + } + case 2: { + message.minute = reader.int32(); + break; + } + case 3: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CutoffTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.CutoffTime} CutoffTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CutoffTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CutoffTime message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CutoffTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hour != null && message.hasOwnProperty("hour")) { + properties._hour = 1; + if (!$util.isInteger(message.hour)) + return "hour: integer expected"; + } + if (message.minute != null && message.hasOwnProperty("minute")) { + properties._minute = 1; + if (!$util.isInteger(message.minute)) + return "minute: integer expected"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + properties._timeZone = 1; + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + } + return null; + }; + + /** + * Creates a CutoffTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.CutoffTime} CutoffTime + */ + CutoffTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CutoffTime) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.CutoffTime(); + if (object.hour != null) + message.hour = object.hour | 0; + if (object.minute != null) + message.minute = object.minute | 0; + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a CutoffTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.CutoffTime} message CutoffTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CutoffTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.hour != null && message.hasOwnProperty("hour")) { + object.hour = message.hour; + if (options.oneofs) + object._hour = "hour"; + } + if (message.minute != null && message.hasOwnProperty("minute")) { + object.minute = message.minute; + if (options.oneofs) + object._minute = "minute"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = message.timeZone; + if (options.oneofs) + object._timeZone = "timeZone"; + } + return object; + }; + + /** + * Converts this CutoffTime to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @instance + * @returns {Object.} JSON object + */ + CutoffTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CutoffTime + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CutoffTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CutoffTime"; + }; + + return CutoffTime; + })(); + + v1beta.BusinessDayConfig = (function() { + + /** + * Properties of a BusinessDayConfig. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IBusinessDayConfig + * @property {Array.|null} [businessDays] BusinessDayConfig businessDays + */ + + /** + * Constructs a new BusinessDayConfig. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a BusinessDayConfig. + * @implements IBusinessDayConfig + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig=} [properties] Properties to set + */ + function BusinessDayConfig(properties) { + this.businessDays = []; + 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]]; + } + + /** + * BusinessDayConfig businessDays. + * @member {Array.} businessDays + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @instance + */ + BusinessDayConfig.prototype.businessDays = $util.emptyArray; + + /** + * Creates a new BusinessDayConfig instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.BusinessDayConfig} BusinessDayConfig instance + */ + BusinessDayConfig.create = function create(properties) { + return new BusinessDayConfig(properties); + }; + + /** + * Encodes the specified BusinessDayConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig} message BusinessDayConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BusinessDayConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.businessDays != null && message.businessDays.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.businessDays.length; ++i) + writer.int32(message.businessDays[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified BusinessDayConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig} message BusinessDayConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BusinessDayConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BusinessDayConfig message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @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.BusinessDayConfig} BusinessDayConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BusinessDayConfig.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.BusinessDayConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.businessDays && message.businessDays.length)) + message.businessDays = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.businessDays.push(reader.int32()); + } else + message.businessDays.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BusinessDayConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.BusinessDayConfig} BusinessDayConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BusinessDayConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BusinessDayConfig message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BusinessDayConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.businessDays != null && message.hasOwnProperty("businessDays")) { + if (!Array.isArray(message.businessDays)) + return "businessDays: array expected"; + for (var i = 0; i < message.businessDays.length; ++i) + switch (message.businessDays[i]) { + default: + return "businessDays: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a BusinessDayConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.BusinessDayConfig} BusinessDayConfig + */ + BusinessDayConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig(); + if (object.businessDays) { + if (!Array.isArray(object.businessDays)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessDayConfig.businessDays: array expected"); + message.businessDays = []; + for (var i = 0; i < object.businessDays.length; ++i) + switch (object.businessDays[i]) { + default: + if (typeof object.businessDays[i] === "number") { + message.businessDays[i] = object.businessDays[i]; + break; + } + case "WEEKDAY_UNSPECIFIED": + case 0: + message.businessDays[i] = 0; + break; + case "MONDAY": + case 1: + message.businessDays[i] = 1; + break; + case "TUESDAY": + case 2: + message.businessDays[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.businessDays[i] = 3; + break; + case "THURSDAY": + case 4: + message.businessDays[i] = 4; + break; + case "FRIDAY": + case 5: + message.businessDays[i] = 5; + break; + case "SATURDAY": + case 6: + message.businessDays[i] = 6; + break; + case "SUNDAY": + case 7: + message.businessDays[i] = 7; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a BusinessDayConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @static + * @param {google.shopping.merchant.accounts.v1beta.BusinessDayConfig} message BusinessDayConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BusinessDayConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.businessDays = []; + if (message.businessDays && message.businessDays.length) { + object.businessDays = []; + for (var j = 0; j < message.businessDays.length; ++j) + object.businessDays[j] = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday[message.businessDays[j]] === undefined ? message.businessDays[j] : $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday[message.businessDays[j]] : message.businessDays[j]; + } + return object; + }; + + /** + * Converts this BusinessDayConfig to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @instance + * @returns {Object.} JSON object + */ + BusinessDayConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BusinessDayConfig + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BusinessDayConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.BusinessDayConfig"; + }; + + /** + * Weekday enum. + * @name google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday + * @enum {number} + * @property {number} WEEKDAY_UNSPECIFIED=0 WEEKDAY_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + BusinessDayConfig.Weekday = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEEKDAY_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + return BusinessDayConfig; + })(); + + v1beta.WarehouseBasedDeliveryTime = (function() { + + /** + * Properties of a WarehouseBasedDeliveryTime. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IWarehouseBasedDeliveryTime + * @property {string|null} [carrier] WarehouseBasedDeliveryTime carrier + * @property {string|null} [carrierService] WarehouseBasedDeliveryTime carrierService + * @property {string|null} [warehouse] WarehouseBasedDeliveryTime warehouse + */ + + /** + * Constructs a new WarehouseBasedDeliveryTime. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a WarehouseBasedDeliveryTime. + * @implements IWarehouseBasedDeliveryTime + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime=} [properties] Properties to set + */ + function WarehouseBasedDeliveryTime(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]]; + } + + /** + * WarehouseBasedDeliveryTime carrier. + * @member {string|null|undefined} carrier + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @instance + */ + WarehouseBasedDeliveryTime.prototype.carrier = null; + + /** + * WarehouseBasedDeliveryTime carrierService. + * @member {string|null|undefined} carrierService + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @instance + */ + WarehouseBasedDeliveryTime.prototype.carrierService = null; + + /** + * WarehouseBasedDeliveryTime warehouse. + * @member {string|null|undefined} warehouse + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @instance + */ + WarehouseBasedDeliveryTime.prototype.warehouse = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WarehouseBasedDeliveryTime _carrier. + * @member {"carrier"|undefined} _carrier + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @instance + */ + Object.defineProperty(WarehouseBasedDeliveryTime.prototype, "_carrier", { + get: $util.oneOfGetter($oneOfFields = ["carrier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * WarehouseBasedDeliveryTime _carrierService. + * @member {"carrierService"|undefined} _carrierService + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @instance + */ + Object.defineProperty(WarehouseBasedDeliveryTime.prototype, "_carrierService", { + get: $util.oneOfGetter($oneOfFields = ["carrierService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * WarehouseBasedDeliveryTime _warehouse. + * @member {"warehouse"|undefined} _warehouse + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @instance + */ + Object.defineProperty(WarehouseBasedDeliveryTime.prototype, "_warehouse", { + get: $util.oneOfGetter($oneOfFields = ["warehouse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WarehouseBasedDeliveryTime instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime} WarehouseBasedDeliveryTime instance + */ + WarehouseBasedDeliveryTime.create = function create(properties) { + return new WarehouseBasedDeliveryTime(properties); + }; + + /** + * Encodes the specified WarehouseBasedDeliveryTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime} message WarehouseBasedDeliveryTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WarehouseBasedDeliveryTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.carrier != null && Object.hasOwnProperty.call(message, "carrier")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.carrier); + if (message.carrierService != null && Object.hasOwnProperty.call(message, "carrierService")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.carrierService); + if (message.warehouse != null && Object.hasOwnProperty.call(message, "warehouse")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.warehouse); + return writer; + }; + + /** + * Encodes the specified WarehouseBasedDeliveryTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime} message WarehouseBasedDeliveryTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WarehouseBasedDeliveryTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WarehouseBasedDeliveryTime message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @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.WarehouseBasedDeliveryTime} WarehouseBasedDeliveryTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WarehouseBasedDeliveryTime.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.WarehouseBasedDeliveryTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.carrier = reader.string(); + break; + } + case 2: { + message.carrierService = reader.string(); + break; + } + case 3: { + message.warehouse = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WarehouseBasedDeliveryTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime} WarehouseBasedDeliveryTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WarehouseBasedDeliveryTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WarehouseBasedDeliveryTime message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WarehouseBasedDeliveryTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.carrier != null && message.hasOwnProperty("carrier")) { + properties._carrier = 1; + if (!$util.isString(message.carrier)) + return "carrier: string expected"; + } + if (message.carrierService != null && message.hasOwnProperty("carrierService")) { + properties._carrierService = 1; + if (!$util.isString(message.carrierService)) + return "carrierService: string expected"; + } + if (message.warehouse != null && message.hasOwnProperty("warehouse")) { + properties._warehouse = 1; + if (!$util.isString(message.warehouse)) + return "warehouse: string expected"; + } + return null; + }; + + /** + * Creates a WarehouseBasedDeliveryTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime} WarehouseBasedDeliveryTime + */ + WarehouseBasedDeliveryTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime(); + if (object.carrier != null) + message.carrier = String(object.carrier); + if (object.carrierService != null) + message.carrierService = String(object.carrierService); + if (object.warehouse != null) + message.warehouse = String(object.warehouse); + return message; + }; + + /** + * Creates a plain object from a WarehouseBasedDeliveryTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @static + * @param {google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime} message WarehouseBasedDeliveryTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WarehouseBasedDeliveryTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.carrier != null && message.hasOwnProperty("carrier")) { + object.carrier = message.carrier; + if (options.oneofs) + object._carrier = "carrier"; + } + if (message.carrierService != null && message.hasOwnProperty("carrierService")) { + object.carrierService = message.carrierService; + if (options.oneofs) + object._carrierService = "carrierService"; + } + if (message.warehouse != null && message.hasOwnProperty("warehouse")) { + object.warehouse = message.warehouse; + if (options.oneofs) + object._warehouse = "warehouse"; + } + return object; + }; + + /** + * Converts this WarehouseBasedDeliveryTime to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @instance + * @returns {Object.} JSON object + */ + WarehouseBasedDeliveryTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WarehouseBasedDeliveryTime + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WarehouseBasedDeliveryTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime"; + }; + + return WarehouseBasedDeliveryTime; + })(); + + v1beta.RateGroup = (function() { + + /** + * Properties of a RateGroup. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IRateGroup + * @property {Array.|null} [applicableShippingLabels] RateGroup applicableShippingLabels + * @property {google.shopping.merchant.accounts.v1beta.IValue|null} [singleValue] RateGroup singleValue + * @property {google.shopping.merchant.accounts.v1beta.ITable|null} [mainTable] RateGroup mainTable + * @property {Array.|null} [subtables] RateGroup subtables + * @property {Array.|null} [carrierRates] RateGroup carrierRates + * @property {string|null} [name] RateGroup name + */ + + /** + * Constructs a new RateGroup. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a RateGroup. + * @implements IRateGroup + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IRateGroup=} [properties] Properties to set + */ + function RateGroup(properties) { + this.applicableShippingLabels = []; + this.subtables = []; + this.carrierRates = []; + 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]]; + } + + /** + * RateGroup applicableShippingLabels. + * @member {Array.} applicableShippingLabels + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + */ + RateGroup.prototype.applicableShippingLabels = $util.emptyArray; + + /** + * RateGroup singleValue. + * @member {google.shopping.merchant.accounts.v1beta.IValue|null|undefined} singleValue + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + */ + RateGroup.prototype.singleValue = null; + + /** + * RateGroup mainTable. + * @member {google.shopping.merchant.accounts.v1beta.ITable|null|undefined} mainTable + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + */ + RateGroup.prototype.mainTable = null; + + /** + * RateGroup subtables. + * @member {Array.} subtables + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + */ + RateGroup.prototype.subtables = $util.emptyArray; + + /** + * RateGroup carrierRates. + * @member {Array.} carrierRates + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + */ + RateGroup.prototype.carrierRates = $util.emptyArray; + + /** + * RateGroup name. + * @member {string|null|undefined} name + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + */ + RateGroup.prototype.name = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RateGroup _singleValue. + * @member {"singleValue"|undefined} _singleValue + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + */ + Object.defineProperty(RateGroup.prototype, "_singleValue", { + get: $util.oneOfGetter($oneOfFields = ["singleValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RateGroup _mainTable. + * @member {"mainTable"|undefined} _mainTable + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + */ + Object.defineProperty(RateGroup.prototype, "_mainTable", { + get: $util.oneOfGetter($oneOfFields = ["mainTable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RateGroup _name. + * @member {"name"|undefined} _name + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + */ + Object.defineProperty(RateGroup.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RateGroup instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRateGroup=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.RateGroup} RateGroup instance + */ + RateGroup.create = function create(properties) { + return new RateGroup(properties); + }; + + /** + * Encodes the specified RateGroup message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RateGroup.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRateGroup} message RateGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RateGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.applicableShippingLabels != null && message.applicableShippingLabels.length) + for (var i = 0; i < message.applicableShippingLabels.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.applicableShippingLabels[i]); + if (message.singleValue != null && Object.hasOwnProperty.call(message, "singleValue")) + $root.google.shopping.merchant.accounts.v1beta.Value.encode(message.singleValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mainTable != null && Object.hasOwnProperty.call(message, "mainTable")) + $root.google.shopping.merchant.accounts.v1beta.Table.encode(message.mainTable, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.subtables != null && message.subtables.length) + for (var i = 0; i < message.subtables.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Table.encode(message.subtables[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.carrierRates != null && message.carrierRates.length) + for (var i = 0; i < message.carrierRates.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.CarrierRate.encode(message.carrierRates[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + return writer; + }; + + /** + * Encodes the specified RateGroup message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RateGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRateGroup} message RateGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RateGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RateGroup message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @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.RateGroup} RateGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RateGroup.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.RateGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.applicableShippingLabels && message.applicableShippingLabels.length)) + message.applicableShippingLabels = []; + message.applicableShippingLabels.push(reader.string()); + break; + } + case 2: { + message.singleValue = $root.google.shopping.merchant.accounts.v1beta.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + message.mainTable = $root.google.shopping.merchant.accounts.v1beta.Table.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.subtables && message.subtables.length)) + message.subtables = []; + message.subtables.push($root.google.shopping.merchant.accounts.v1beta.Table.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.carrierRates && message.carrierRates.length)) + message.carrierRates = []; + message.carrierRates.push($root.google.shopping.merchant.accounts.v1beta.CarrierRate.decode(reader, reader.uint32())); + break; + } + case 6: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RateGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.RateGroup} RateGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RateGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RateGroup message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RateGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.applicableShippingLabels != null && message.hasOwnProperty("applicableShippingLabels")) { + if (!Array.isArray(message.applicableShippingLabels)) + return "applicableShippingLabels: array expected"; + for (var i = 0; i < message.applicableShippingLabels.length; ++i) + if (!$util.isString(message.applicableShippingLabels[i])) + return "applicableShippingLabels: string[] expected"; + } + if (message.singleValue != null && message.hasOwnProperty("singleValue")) { + properties._singleValue = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Value.verify(message.singleValue); + if (error) + return "singleValue." + error; + } + } + if (message.mainTable != null && message.hasOwnProperty("mainTable")) { + properties._mainTable = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Table.verify(message.mainTable); + if (error) + return "mainTable." + error; + } + } + if (message.subtables != null && message.hasOwnProperty("subtables")) { + if (!Array.isArray(message.subtables)) + return "subtables: array expected"; + for (var i = 0; i < message.subtables.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Table.verify(message.subtables[i]); + if (error) + return "subtables." + error; + } + } + if (message.carrierRates != null && message.hasOwnProperty("carrierRates")) { + if (!Array.isArray(message.carrierRates)) + return "carrierRates: array expected"; + for (var i = 0; i < message.carrierRates.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.CarrierRate.verify(message.carrierRates[i]); + if (error) + return "carrierRates." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + return null; + }; + + /** + * Creates a RateGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.RateGroup} RateGroup + */ + RateGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.RateGroup) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.RateGroup(); + if (object.applicableShippingLabels) { + if (!Array.isArray(object.applicableShippingLabels)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.applicableShippingLabels: array expected"); + message.applicableShippingLabels = []; + for (var i = 0; i < object.applicableShippingLabels.length; ++i) + message.applicableShippingLabels[i] = String(object.applicableShippingLabels[i]); + } + if (object.singleValue != null) { + if (typeof object.singleValue !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.singleValue: object expected"); + message.singleValue = $root.google.shopping.merchant.accounts.v1beta.Value.fromObject(object.singleValue); + } + if (object.mainTable != null) { + if (typeof object.mainTable !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.mainTable: object expected"); + message.mainTable = $root.google.shopping.merchant.accounts.v1beta.Table.fromObject(object.mainTable); + } + if (object.subtables) { + if (!Array.isArray(object.subtables)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.subtables: array expected"); + message.subtables = []; + for (var i = 0; i < object.subtables.length; ++i) { + if (typeof object.subtables[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.subtables: object expected"); + message.subtables[i] = $root.google.shopping.merchant.accounts.v1beta.Table.fromObject(object.subtables[i]); + } + } + if (object.carrierRates) { + if (!Array.isArray(object.carrierRates)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.carrierRates: array expected"); + message.carrierRates = []; + for (var i = 0; i < object.carrierRates.length; ++i) { + if (typeof object.carrierRates[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.carrierRates: object expected"); + message.carrierRates[i] = $root.google.shopping.merchant.accounts.v1beta.CarrierRate.fromObject(object.carrierRates[i]); + } + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RateGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @static + * @param {google.shopping.merchant.accounts.v1beta.RateGroup} message RateGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RateGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.applicableShippingLabels = []; + object.subtables = []; + object.carrierRates = []; + } + if (message.applicableShippingLabels && message.applicableShippingLabels.length) { + object.applicableShippingLabels = []; + for (var j = 0; j < message.applicableShippingLabels.length; ++j) + object.applicableShippingLabels[j] = message.applicableShippingLabels[j]; + } + if (message.singleValue != null && message.hasOwnProperty("singleValue")) { + object.singleValue = $root.google.shopping.merchant.accounts.v1beta.Value.toObject(message.singleValue, options); + if (options.oneofs) + object._singleValue = "singleValue"; + } + if (message.mainTable != null && message.hasOwnProperty("mainTable")) { + object.mainTable = $root.google.shopping.merchant.accounts.v1beta.Table.toObject(message.mainTable, options); + if (options.oneofs) + object._mainTable = "mainTable"; + } + if (message.subtables && message.subtables.length) { + object.subtables = []; + for (var j = 0; j < message.subtables.length; ++j) + object.subtables[j] = $root.google.shopping.merchant.accounts.v1beta.Table.toObject(message.subtables[j], options); + } + if (message.carrierRates && message.carrierRates.length) { + object.carrierRates = []; + for (var j = 0; j < message.carrierRates.length; ++j) + object.carrierRates[j] = $root.google.shopping.merchant.accounts.v1beta.CarrierRate.toObject(message.carrierRates[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + return object; + }; + + /** + * Converts this RateGroup to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @instance + * @returns {Object.} JSON object + */ + RateGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RateGroup + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.RateGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RateGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.RateGroup"; + }; + + return RateGroup; + })(); + + v1beta.Table = (function() { + + /** + * Properties of a Table. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ITable + * @property {string|null} [name] Table name + * @property {google.shopping.merchant.accounts.v1beta.IHeaders|null} [rowHeaders] Table rowHeaders + * @property {google.shopping.merchant.accounts.v1beta.IHeaders|null} [columnHeaders] Table columnHeaders + * @property {Array.|null} [rows] Table rows + */ + + /** + * Constructs a new Table. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Table. + * @implements ITable + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ITable=} [properties] Properties to set + */ + function Table(properties) { + this.rows = []; + 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]]; + } + + /** + * Table name. + * @member {string|null|undefined} name + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @instance + */ + Table.prototype.name = null; + + /** + * Table rowHeaders. + * @member {google.shopping.merchant.accounts.v1beta.IHeaders|null|undefined} rowHeaders + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @instance + */ + Table.prototype.rowHeaders = null; + + /** + * Table columnHeaders. + * @member {google.shopping.merchant.accounts.v1beta.IHeaders|null|undefined} columnHeaders + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @instance + */ + Table.prototype.columnHeaders = null; + + /** + * Table rows. + * @member {Array.} rows + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @instance + */ + Table.prototype.rows = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Table _name. + * @member {"name"|undefined} _name + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @instance + */ + Object.defineProperty(Table.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Table _rowHeaders. + * @member {"rowHeaders"|undefined} _rowHeaders + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @instance + */ + Object.defineProperty(Table.prototype, "_rowHeaders", { + get: $util.oneOfGetter($oneOfFields = ["rowHeaders"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Table _columnHeaders. + * @member {"columnHeaders"|undefined} _columnHeaders + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @instance + */ + Object.defineProperty(Table.prototype, "_columnHeaders", { + get: $util.oneOfGetter($oneOfFields = ["columnHeaders"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Table instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITable=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Table} Table instance + */ + Table.create = function create(properties) { + return new Table(properties); + }; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Table.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.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.rowHeaders != null && Object.hasOwnProperty.call(message, "rowHeaders")) + $root.google.shopping.merchant.accounts.v1beta.Headers.encode(message.rowHeaders, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.columnHeaders != null && Object.hasOwnProperty.call(message, "columnHeaders")) + $root.google.shopping.merchant.accounts.v1beta.Headers.encode(message.columnHeaders, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Row.encode(message.rows[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Table.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITable} message Table message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Table.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Table message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @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.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.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.Table(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.rowHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.decode(reader, reader.uint32()); + break; + } + case 3: { + message.columnHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.shopping.merchant.accounts.v1beta.Row.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Table message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Table} Table + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Table.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Table message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Table.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.rowHeaders != null && message.hasOwnProperty("rowHeaders")) { + properties._rowHeaders = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Headers.verify(message.rowHeaders); + if (error) + return "rowHeaders." + error; + } + } + if (message.columnHeaders != null && message.hasOwnProperty("columnHeaders")) { + properties._columnHeaders = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Headers.verify(message.columnHeaders); + if (error) + return "columnHeaders." + error; + } + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates a Table message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Table} Table + */ + Table.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Table) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Table(); + if (object.name != null) + message.name = String(object.name); + if (object.rowHeaders != null) { + if (typeof object.rowHeaders !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Table.rowHeaders: object expected"); + message.rowHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.fromObject(object.rowHeaders); + } + if (object.columnHeaders != null) { + if (typeof object.columnHeaders !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Table.columnHeaders: object expected"); + message.columnHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.fromObject(object.columnHeaders); + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Table.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Table.rows: object expected"); + message.rows[i] = $root.google.shopping.merchant.accounts.v1beta.Row.fromObject(object.rows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Table message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @static + * @param {google.shopping.merchant.accounts.v1beta.Table} message Table + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Table.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.rowHeaders != null && message.hasOwnProperty("rowHeaders")) { + object.rowHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.toObject(message.rowHeaders, options); + if (options.oneofs) + object._rowHeaders = "rowHeaders"; + } + if (message.columnHeaders != null && message.hasOwnProperty("columnHeaders")) { + object.columnHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.toObject(message.columnHeaders, options); + if (options.oneofs) + object._columnHeaders = "columnHeaders"; + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.shopping.merchant.accounts.v1beta.Row.toObject(message.rows[j], options); + } + return object; + }; + + /** + * Converts this Table to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @instance + * @returns {Object.} JSON object + */ + Table.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Table + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Table + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Table.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Table"; + }; + + return Table; + })(); + + v1beta.TransitTable = (function() { + + /** + * Properties of a TransitTable. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ITransitTable + * @property {Array.|null} [postalCodeGroupNames] TransitTable postalCodeGroupNames + * @property {Array.|null} [transitTimeLabels] TransitTable transitTimeLabels + * @property {Array.|null} [rows] TransitTable rows + */ + + /** + * Constructs a new TransitTable. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a TransitTable. + * @implements ITransitTable + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ITransitTable=} [properties] Properties to set + */ + function TransitTable(properties) { + this.postalCodeGroupNames = []; + this.transitTimeLabels = []; + this.rows = []; + 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]]; + } + + /** + * TransitTable postalCodeGroupNames. + * @member {Array.} postalCodeGroupNames + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @instance + */ + TransitTable.prototype.postalCodeGroupNames = $util.emptyArray; + + /** + * TransitTable transitTimeLabels. + * @member {Array.} transitTimeLabels + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @instance + */ + TransitTable.prototype.transitTimeLabels = $util.emptyArray; + + /** + * TransitTable rows. + * @member {Array.} rows + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @instance + */ + TransitTable.prototype.rows = $util.emptyArray; + + /** + * Creates a new TransitTable instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITransitTable=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.TransitTable} TransitTable instance + */ + TransitTable.create = function create(properties) { + return new TransitTable(properties); + }; + + /** + * Encodes the specified TransitTable message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITransitTable} message TransitTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitTable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.postalCodeGroupNames != null && message.postalCodeGroupNames.length) + for (var i = 0; i < message.postalCodeGroupNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.postalCodeGroupNames[i]); + if (message.transitTimeLabels != null && message.transitTimeLabels.length) + for (var i = 0; i < message.transitTimeLabels.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.transitTimeLabels[i]); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.encode(message.rows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitTable message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITransitTable} message TransitTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitTable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitTable message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @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.TransitTable} TransitTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitTable.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.TransitTable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.postalCodeGroupNames && message.postalCodeGroupNames.length)) + message.postalCodeGroupNames = []; + message.postalCodeGroupNames.push(reader.string()); + break; + } + case 2: { + if (!(message.transitTimeLabels && message.transitTimeLabels.length)) + message.transitTimeLabels = []; + message.transitTimeLabels.push(reader.string()); + break; + } + case 3: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitTable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.TransitTable} TransitTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitTable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitTable message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitTable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.postalCodeGroupNames != null && message.hasOwnProperty("postalCodeGroupNames")) { + if (!Array.isArray(message.postalCodeGroupNames)) + return "postalCodeGroupNames: array expected"; + for (var i = 0; i < message.postalCodeGroupNames.length; ++i) + if (!$util.isString(message.postalCodeGroupNames[i])) + return "postalCodeGroupNames: string[] expected"; + } + if (message.transitTimeLabels != null && message.hasOwnProperty("transitTimeLabels")) { + if (!Array.isArray(message.transitTimeLabels)) + return "transitTimeLabels: array expected"; + for (var i = 0; i < message.transitTimeLabels.length; ++i) + if (!$util.isString(message.transitTimeLabels[i])) + return "transitTimeLabels: string[] expected"; + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + return null; + }; + + /** + * Creates a TransitTable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.TransitTable} TransitTable + */ + TransitTable.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TransitTable) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.TransitTable(); + if (object.postalCodeGroupNames) { + if (!Array.isArray(object.postalCodeGroupNames)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.postalCodeGroupNames: array expected"); + message.postalCodeGroupNames = []; + for (var i = 0; i < object.postalCodeGroupNames.length; ++i) + message.postalCodeGroupNames[i] = String(object.postalCodeGroupNames[i]); + } + if (object.transitTimeLabels) { + if (!Array.isArray(object.transitTimeLabels)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.transitTimeLabels: array expected"); + message.transitTimeLabels = []; + for (var i = 0; i < object.transitTimeLabels.length; ++i) + message.transitTimeLabels[i] = String(object.transitTimeLabels[i]); + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.rows: object expected"); + message.rows[i] = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.fromObject(object.rows[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TransitTable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @static + * @param {google.shopping.merchant.accounts.v1beta.TransitTable} message TransitTable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitTable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.postalCodeGroupNames = []; + object.transitTimeLabels = []; + object.rows = []; + } + if (message.postalCodeGroupNames && message.postalCodeGroupNames.length) { + object.postalCodeGroupNames = []; + for (var j = 0; j < message.postalCodeGroupNames.length; ++j) + object.postalCodeGroupNames[j] = message.postalCodeGroupNames[j]; + } + if (message.transitTimeLabels && message.transitTimeLabels.length) { + object.transitTimeLabels = []; + for (var j = 0; j < message.transitTimeLabels.length; ++j) + object.transitTimeLabels[j] = message.transitTimeLabels[j]; + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.toObject(message.rows[j], options); + } + return object; + }; + + /** + * Converts this TransitTable to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @instance + * @returns {Object.} JSON object + */ + TransitTable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitTable + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitTable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TransitTable"; + }; + + TransitTable.TransitTimeRow = (function() { + + /** + * Properties of a TransitTimeRow. + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @interface ITransitTimeRow + * @property {Array.|null} [values] TransitTimeRow values + */ + + /** + * Constructs a new TransitTimeRow. + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable + * @classdesc Represents a TransitTimeRow. + * @implements ITransitTimeRow + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow=} [properties] Properties to set + */ + function TransitTimeRow(properties) { + this.values = []; + 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]]; + } + + /** + * TransitTimeRow values. + * @member {Array.} values + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @instance + */ + TransitTimeRow.prototype.values = $util.emptyArray; + + /** + * Creates a new TransitTimeRow instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @static + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow} TransitTimeRow instance + */ + TransitTimeRow.create = function create(properties) { + return new TransitTimeRow(properties); + }; + + /** + * Encodes the specified TransitTimeRow message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @static + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow} message TransitTimeRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitTimeRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransitTimeRow message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @static + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow} message TransitTimeRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitTimeRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitTimeRow message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @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.TransitTable.TransitTimeRow} TransitTimeRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitTimeRow.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.TransitTable.TransitTimeRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitTimeRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow} TransitTimeRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitTimeRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitTimeRow message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitTimeRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a TransitTimeRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow} TransitTimeRow + */ + TransitTimeRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.values: object expected"); + message.values[i] = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TransitTimeRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @static + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow} message TransitTimeRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitTimeRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this TransitTimeRow to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @instance + * @returns {Object.} JSON object + */ + TransitTimeRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitTimeRow + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitTimeRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow"; + }; + + TransitTimeRow.TransitTimeValue = (function() { + + /** + * Properties of a TransitTimeValue. + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @interface ITransitTimeValue + * @property {number|null} [minTransitDays] TransitTimeValue minTransitDays + * @property {number|null} [maxTransitDays] TransitTimeValue maxTransitDays + */ + + /** + * Constructs a new TransitTimeValue. + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow + * @classdesc Represents a TransitTimeValue. + * @implements ITransitTimeValue + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue=} [properties] Properties to set + */ + function TransitTimeValue(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]]; + } + + /** + * TransitTimeValue minTransitDays. + * @member {number|null|undefined} minTransitDays + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @instance + */ + TransitTimeValue.prototype.minTransitDays = null; + + /** + * TransitTimeValue maxTransitDays. + * @member {number|null|undefined} maxTransitDays + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @instance + */ + TransitTimeValue.prototype.maxTransitDays = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransitTimeValue _minTransitDays. + * @member {"minTransitDays"|undefined} _minTransitDays + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @instance + */ + Object.defineProperty(TransitTimeValue.prototype, "_minTransitDays", { + get: $util.oneOfGetter($oneOfFields = ["minTransitDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransitTimeValue _maxTransitDays. + * @member {"maxTransitDays"|undefined} _maxTransitDays + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @instance + */ + Object.defineProperty(TransitTimeValue.prototype, "_maxTransitDays", { + get: $util.oneOfGetter($oneOfFields = ["maxTransitDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransitTimeValue instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @static + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue} TransitTimeValue instance + */ + TransitTimeValue.create = function create(properties) { + return new TransitTimeValue(properties); + }; + + /** + * Encodes the specified TransitTimeValue message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @static + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue} message TransitTimeValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitTimeValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minTransitDays != null && Object.hasOwnProperty.call(message, "minTransitDays")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minTransitDays); + if (message.maxTransitDays != null && Object.hasOwnProperty.call(message, "maxTransitDays")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxTransitDays); + return writer; + }; + + /** + * Encodes the specified TransitTimeValue message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @static + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue} message TransitTimeValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransitTimeValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransitTimeValue message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @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.TransitTable.TransitTimeRow.TransitTimeValue} TransitTimeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitTimeValue.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.TransitTable.TransitTimeRow.TransitTimeValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minTransitDays = reader.int32(); + break; + } + case 2: { + message.maxTransitDays = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransitTimeValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue} TransitTimeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransitTimeValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransitTimeValue message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransitTimeValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.minTransitDays != null && message.hasOwnProperty("minTransitDays")) { + properties._minTransitDays = 1; + if (!$util.isInteger(message.minTransitDays)) + return "minTransitDays: integer expected"; + } + if (message.maxTransitDays != null && message.hasOwnProperty("maxTransitDays")) { + properties._maxTransitDays = 1; + if (!$util.isInteger(message.maxTransitDays)) + return "maxTransitDays: integer expected"; + } + return null; + }; + + /** + * Creates a TransitTimeValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue} TransitTimeValue + */ + TransitTimeValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue(); + if (object.minTransitDays != null) + message.minTransitDays = object.minTransitDays | 0; + if (object.maxTransitDays != null) + message.maxTransitDays = object.maxTransitDays | 0; + return message; + }; + + /** + * Creates a plain object from a TransitTimeValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @static + * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue} message TransitTimeValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransitTimeValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.minTransitDays != null && message.hasOwnProperty("minTransitDays")) { + object.minTransitDays = message.minTransitDays; + if (options.oneofs) + object._minTransitDays = "minTransitDays"; + } + if (message.maxTransitDays != null && message.hasOwnProperty("maxTransitDays")) { + object.maxTransitDays = message.maxTransitDays; + if (options.oneofs) + object._maxTransitDays = "maxTransitDays"; + } + return object; + }; + + /** + * Converts this TransitTimeValue to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @instance + * @returns {Object.} JSON object + */ + TransitTimeValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransitTimeValue + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransitTimeValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue"; + }; + + return TransitTimeValue; + })(); + + return TransitTimeRow; + })(); + + return TransitTable; + })(); + + v1beta.MinimumOrderValueTable = (function() { + + /** + * Properties of a MinimumOrderValueTable. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IMinimumOrderValueTable + * @property {Array.|null} [storeCodeSetWithMovs] MinimumOrderValueTable storeCodeSetWithMovs + */ + + /** + * Constructs a new MinimumOrderValueTable. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a MinimumOrderValueTable. + * @implements IMinimumOrderValueTable + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable=} [properties] Properties to set + */ + function MinimumOrderValueTable(properties) { + this.storeCodeSetWithMovs = []; + 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]]; + } + + /** + * MinimumOrderValueTable storeCodeSetWithMovs. + * @member {Array.} storeCodeSetWithMovs + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @instance + */ + MinimumOrderValueTable.prototype.storeCodeSetWithMovs = $util.emptyArray; + + /** + * Creates a new MinimumOrderValueTable instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @static + * @param {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable} MinimumOrderValueTable instance + */ + MinimumOrderValueTable.create = function create(properties) { + return new MinimumOrderValueTable(properties); + }; + + /** + * Encodes the specified MinimumOrderValueTable message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @static + * @param {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable} message MinimumOrderValueTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MinimumOrderValueTable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.storeCodeSetWithMovs != null && message.storeCodeSetWithMovs.length) + for (var i = 0; i < message.storeCodeSetWithMovs.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.encode(message.storeCodeSetWithMovs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MinimumOrderValueTable message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @static + * @param {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable} message MinimumOrderValueTable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MinimumOrderValueTable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MinimumOrderValueTable message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @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.MinimumOrderValueTable} MinimumOrderValueTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MinimumOrderValueTable.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.MinimumOrderValueTable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.storeCodeSetWithMovs && message.storeCodeSetWithMovs.length)) + message.storeCodeSetWithMovs = []; + message.storeCodeSetWithMovs.push($root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MinimumOrderValueTable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable} MinimumOrderValueTable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MinimumOrderValueTable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MinimumOrderValueTable message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MinimumOrderValueTable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.storeCodeSetWithMovs != null && message.hasOwnProperty("storeCodeSetWithMovs")) { + if (!Array.isArray(message.storeCodeSetWithMovs)) + return "storeCodeSetWithMovs: array expected"; + for (var i = 0; i < message.storeCodeSetWithMovs.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify(message.storeCodeSetWithMovs[i]); + if (error) + return "storeCodeSetWithMovs." + error; + } + } + return null; + }; + + /** + * Creates a MinimumOrderValueTable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable} MinimumOrderValueTable + */ + MinimumOrderValueTable.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable(); + if (object.storeCodeSetWithMovs) { + if (!Array.isArray(object.storeCodeSetWithMovs)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.storeCodeSetWithMovs: array expected"); + message.storeCodeSetWithMovs = []; + for (var i = 0; i < object.storeCodeSetWithMovs.length; ++i) { + if (typeof object.storeCodeSetWithMovs[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.storeCodeSetWithMovs: object expected"); + message.storeCodeSetWithMovs[i] = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.fromObject(object.storeCodeSetWithMovs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MinimumOrderValueTable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @static + * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable} message MinimumOrderValueTable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MinimumOrderValueTable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.storeCodeSetWithMovs = []; + if (message.storeCodeSetWithMovs && message.storeCodeSetWithMovs.length) { + object.storeCodeSetWithMovs = []; + for (var j = 0; j < message.storeCodeSetWithMovs.length; ++j) + object.storeCodeSetWithMovs[j] = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.toObject(message.storeCodeSetWithMovs[j], options); + } + return object; + }; + + /** + * Converts this MinimumOrderValueTable to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @instance + * @returns {Object.} JSON object + */ + MinimumOrderValueTable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MinimumOrderValueTable + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MinimumOrderValueTable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable"; + }; + + MinimumOrderValueTable.StoreCodeSetWithMov = (function() { + + /** + * Properties of a StoreCodeSetWithMov. + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @interface IStoreCodeSetWithMov + * @property {Array.|null} [storeCodes] StoreCodeSetWithMov storeCodes + * @property {google.shopping.type.IPrice|null} [value] StoreCodeSetWithMov value + */ + + /** + * Constructs a new StoreCodeSetWithMov. + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable + * @classdesc Represents a StoreCodeSetWithMov. + * @implements IStoreCodeSetWithMov + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov=} [properties] Properties to set + */ + function StoreCodeSetWithMov(properties) { + this.storeCodes = []; + 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]]; + } + + /** + * StoreCodeSetWithMov storeCodes. + * @member {Array.} storeCodes + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @instance + */ + StoreCodeSetWithMov.prototype.storeCodes = $util.emptyArray; + + /** + * StoreCodeSetWithMov value. + * @member {google.shopping.type.IPrice|null|undefined} value + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @instance + */ + StoreCodeSetWithMov.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StoreCodeSetWithMov _value. + * @member {"value"|undefined} _value + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @instance + */ + Object.defineProperty(StoreCodeSetWithMov.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StoreCodeSetWithMov instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @static + * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov} StoreCodeSetWithMov instance + */ + StoreCodeSetWithMov.create = function create(properties) { + return new StoreCodeSetWithMov(properties); + }; + + /** + * Encodes the specified StoreCodeSetWithMov message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @static + * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov} message StoreCodeSetWithMov message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoreCodeSetWithMov.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.storeCodes != null && message.storeCodes.length) + for (var i = 0; i < message.storeCodes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.storeCodes[i]); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.shopping.type.Price.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StoreCodeSetWithMov message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @static + * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov} message StoreCodeSetWithMov message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StoreCodeSetWithMov.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StoreCodeSetWithMov message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @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.MinimumOrderValueTable.StoreCodeSetWithMov} StoreCodeSetWithMov + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoreCodeSetWithMov.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.MinimumOrderValueTable.StoreCodeSetWithMov(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.storeCodes && message.storeCodes.length)) + message.storeCodes = []; + message.storeCodes.push(reader.string()); + break; + } + case 2: { + message.value = $root.google.shopping.type.Price.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StoreCodeSetWithMov message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov} StoreCodeSetWithMov + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StoreCodeSetWithMov.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StoreCodeSetWithMov message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StoreCodeSetWithMov.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.storeCodes != null && message.hasOwnProperty("storeCodes")) { + if (!Array.isArray(message.storeCodes)) + return "storeCodes: array expected"; + for (var i = 0; i < message.storeCodes.length; ++i) + if (!$util.isString(message.storeCodes[i])) + return "storeCodes: string[] expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + { + var error = $root.google.shopping.type.Price.verify(message.value); + if (error) + return "value." + error; + } + } + return null; + }; + + /** + * Creates a StoreCodeSetWithMov message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov} StoreCodeSetWithMov + */ + StoreCodeSetWithMov.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov(); + if (object.storeCodes) { + if (!Array.isArray(object.storeCodes)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.storeCodes: array expected"); + message.storeCodes = []; + for (var i = 0; i < object.storeCodes.length; ++i) + message.storeCodes[i] = String(object.storeCodes[i]); + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.value: object expected"); + message.value = $root.google.shopping.type.Price.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a StoreCodeSetWithMov message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @static + * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov} message StoreCodeSetWithMov + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StoreCodeSetWithMov.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.storeCodes = []; + if (message.storeCodes && message.storeCodes.length) { + object.storeCodes = []; + for (var j = 0; j < message.storeCodes.length; ++j) + object.storeCodes[j] = message.storeCodes[j]; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = $root.google.shopping.type.Price.toObject(message.value, options); + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this StoreCodeSetWithMov to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @instance + * @returns {Object.} JSON object + */ + StoreCodeSetWithMov.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StoreCodeSetWithMov + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StoreCodeSetWithMov.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov"; + }; + + return StoreCodeSetWithMov; + })(); + + return MinimumOrderValueTable; + })(); + + v1beta.Headers = (function() { + + /** + * Properties of a Headers. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IHeaders + * @property {Array.|null} [prices] Headers prices + * @property {Array.|null} [weights] Headers weights + * @property {Array.|null} [numberOfItems] Headers numberOfItems + * @property {Array.|null} [postalCodeGroupNames] Headers postalCodeGroupNames + * @property {Array.|null} [locations] Headers locations + */ + + /** + * Constructs a new Headers. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Headers. + * @implements IHeaders + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IHeaders=} [properties] Properties to set + */ + function Headers(properties) { + this.prices = []; + this.weights = []; + this.numberOfItems = []; + this.postalCodeGroupNames = []; + this.locations = []; + 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]]; + } + + /** + * Headers prices. + * @member {Array.} prices + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @instance + */ + Headers.prototype.prices = $util.emptyArray; + + /** + * Headers weights. + * @member {Array.} weights + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @instance + */ + Headers.prototype.weights = $util.emptyArray; + + /** + * Headers numberOfItems. + * @member {Array.} numberOfItems + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @instance + */ + Headers.prototype.numberOfItems = $util.emptyArray; + + /** + * Headers postalCodeGroupNames. + * @member {Array.} postalCodeGroupNames + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @instance + */ + Headers.prototype.postalCodeGroupNames = $util.emptyArray; + + /** + * Headers locations. + * @member {Array.} locations + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @instance + */ + Headers.prototype.locations = $util.emptyArray; + + /** + * Creates a new Headers instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @static + * @param {google.shopping.merchant.accounts.v1beta.IHeaders=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Headers} Headers instance + */ + Headers.create = function create(properties) { + return new Headers(properties); + }; + + /** + * Encodes the specified Headers message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Headers.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @static + * @param {google.shopping.merchant.accounts.v1beta.IHeaders} message Headers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Headers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prices != null && message.prices.length) + for (var i = 0; i < message.prices.length; ++i) + $root.google.shopping.type.Price.encode(message.prices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.weights != null && message.weights.length) + for (var i = 0; i < message.weights.length; ++i) + $root.google.shopping.type.Weight.encode(message.weights[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.numberOfItems != null && message.numberOfItems.length) + for (var i = 0; i < message.numberOfItems.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.numberOfItems[i]); + if (message.postalCodeGroupNames != null && message.postalCodeGroupNames.length) + for (var i = 0; i < message.postalCodeGroupNames.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCodeGroupNames[i]); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.LocationIdSet.encode(message.locations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Headers message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Headers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @static + * @param {google.shopping.merchant.accounts.v1beta.IHeaders} message Headers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Headers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Headers message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @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.Headers} Headers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Headers.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.Headers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.prices && message.prices.length)) + message.prices = []; + message.prices.push($root.google.shopping.type.Price.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.weights && message.weights.length)) + message.weights = []; + message.weights.push($root.google.shopping.type.Weight.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.numberOfItems && message.numberOfItems.length)) + message.numberOfItems = []; + message.numberOfItems.push(reader.string()); + break; + } + case 4: { + if (!(message.postalCodeGroupNames && message.postalCodeGroupNames.length)) + message.postalCodeGroupNames = []; + message.postalCodeGroupNames.push(reader.string()); + break; + } + case 5: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.shopping.merchant.accounts.v1beta.LocationIdSet.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Headers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Headers} Headers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Headers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Headers message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Headers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prices != null && message.hasOwnProperty("prices")) { + if (!Array.isArray(message.prices)) + return "prices: array expected"; + for (var i = 0; i < message.prices.length; ++i) { + var error = $root.google.shopping.type.Price.verify(message.prices[i]); + if (error) + return "prices." + error; + } + } + if (message.weights != null && message.hasOwnProperty("weights")) { + if (!Array.isArray(message.weights)) + return "weights: array expected"; + for (var i = 0; i < message.weights.length; ++i) { + var error = $root.google.shopping.type.Weight.verify(message.weights[i]); + if (error) + return "weights." + error; + } + } + if (message.numberOfItems != null && message.hasOwnProperty("numberOfItems")) { + if (!Array.isArray(message.numberOfItems)) + return "numberOfItems: array expected"; + for (var i = 0; i < message.numberOfItems.length; ++i) + if (!$util.isString(message.numberOfItems[i])) + return "numberOfItems: string[] expected"; + } + if (message.postalCodeGroupNames != null && message.hasOwnProperty("postalCodeGroupNames")) { + if (!Array.isArray(message.postalCodeGroupNames)) + return "postalCodeGroupNames: array expected"; + for (var i = 0; i < message.postalCodeGroupNames.length; ++i) + if (!$util.isString(message.postalCodeGroupNames[i])) + return "postalCodeGroupNames: string[] expected"; + } + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.LocationIdSet.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + return null; + }; + + /** + * Creates a Headers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Headers} Headers + */ + Headers.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Headers) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Headers(); + if (object.prices) { + if (!Array.isArray(object.prices)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.prices: array expected"); + message.prices = []; + for (var i = 0; i < object.prices.length; ++i) { + if (typeof object.prices[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.prices: object expected"); + message.prices[i] = $root.google.shopping.type.Price.fromObject(object.prices[i]); + } + } + if (object.weights) { + if (!Array.isArray(object.weights)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.weights: array expected"); + message.weights = []; + for (var i = 0; i < object.weights.length; ++i) { + if (typeof object.weights[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.weights: object expected"); + message.weights[i] = $root.google.shopping.type.Weight.fromObject(object.weights[i]); + } + } + if (object.numberOfItems) { + if (!Array.isArray(object.numberOfItems)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.numberOfItems: array expected"); + message.numberOfItems = []; + for (var i = 0; i < object.numberOfItems.length; ++i) + message.numberOfItems[i] = String(object.numberOfItems[i]); + } + if (object.postalCodeGroupNames) { + if (!Array.isArray(object.postalCodeGroupNames)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.postalCodeGroupNames: array expected"); + message.postalCodeGroupNames = []; + for (var i = 0; i < object.postalCodeGroupNames.length; ++i) + message.postalCodeGroupNames[i] = String(object.postalCodeGroupNames[i]); + } + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.locations: object expected"); + message.locations[i] = $root.google.shopping.merchant.accounts.v1beta.LocationIdSet.fromObject(object.locations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Headers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @static + * @param {google.shopping.merchant.accounts.v1beta.Headers} message Headers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Headers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.prices = []; + object.weights = []; + object.numberOfItems = []; + object.postalCodeGroupNames = []; + object.locations = []; + } + if (message.prices && message.prices.length) { + object.prices = []; + for (var j = 0; j < message.prices.length; ++j) + object.prices[j] = $root.google.shopping.type.Price.toObject(message.prices[j], options); + } + if (message.weights && message.weights.length) { + object.weights = []; + for (var j = 0; j < message.weights.length; ++j) + object.weights[j] = $root.google.shopping.type.Weight.toObject(message.weights[j], options); + } + if (message.numberOfItems && message.numberOfItems.length) { + object.numberOfItems = []; + for (var j = 0; j < message.numberOfItems.length; ++j) + object.numberOfItems[j] = message.numberOfItems[j]; + } + if (message.postalCodeGroupNames && message.postalCodeGroupNames.length) { + object.postalCodeGroupNames = []; + for (var j = 0; j < message.postalCodeGroupNames.length; ++j) + object.postalCodeGroupNames[j] = message.postalCodeGroupNames[j]; + } + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.shopping.merchant.accounts.v1beta.LocationIdSet.toObject(message.locations[j], options); + } + return object; + }; + + /** + * Converts this Headers to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @instance + * @returns {Object.} JSON object + */ + Headers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Headers + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Headers + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Headers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Headers"; + }; + + return Headers; + })(); + + v1beta.LocationIdSet = (function() { + + /** + * Properties of a LocationIdSet. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ILocationIdSet + * @property {Array.|null} [locationIds] LocationIdSet locationIds + */ + + /** + * Constructs a new LocationIdSet. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a LocationIdSet. + * @implements ILocationIdSet + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ILocationIdSet=} [properties] Properties to set + */ + function LocationIdSet(properties) { + this.locationIds = []; + 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]]; + } + + /** + * LocationIdSet locationIds. + * @member {Array.} locationIds + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @instance + */ + LocationIdSet.prototype.locationIds = $util.emptyArray; + + /** + * Creates a new LocationIdSet instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @static + * @param {google.shopping.merchant.accounts.v1beta.ILocationIdSet=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.LocationIdSet} LocationIdSet instance + */ + LocationIdSet.create = function create(properties) { + return new LocationIdSet(properties); + }; + + /** + * Encodes the specified LocationIdSet message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.LocationIdSet.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @static + * @param {google.shopping.merchant.accounts.v1beta.ILocationIdSet} message LocationIdSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationIdSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locationIds != null && message.locationIds.length) + for (var i = 0; i < message.locationIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationIds[i]); + return writer; + }; + + /** + * Encodes the specified LocationIdSet message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.LocationIdSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @static + * @param {google.shopping.merchant.accounts.v1beta.ILocationIdSet} message LocationIdSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationIdSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationIdSet message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @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.LocationIdSet} LocationIdSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationIdSet.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.LocationIdSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.locationIds && message.locationIds.length)) + message.locationIds = []; + message.locationIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationIdSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.LocationIdSet} LocationIdSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationIdSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationIdSet message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationIdSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locationIds != null && message.hasOwnProperty("locationIds")) { + if (!Array.isArray(message.locationIds)) + return "locationIds: array expected"; + for (var i = 0; i < message.locationIds.length; ++i) + if (!$util.isString(message.locationIds[i])) + return "locationIds: string[] expected"; + } + return null; + }; + + /** + * Creates a LocationIdSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.LocationIdSet} LocationIdSet + */ + LocationIdSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.LocationIdSet) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.LocationIdSet(); + if (object.locationIds) { + if (!Array.isArray(object.locationIds)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.LocationIdSet.locationIds: array expected"); + message.locationIds = []; + for (var i = 0; i < object.locationIds.length; ++i) + message.locationIds[i] = String(object.locationIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a LocationIdSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @static + * @param {google.shopping.merchant.accounts.v1beta.LocationIdSet} message LocationIdSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationIdSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.locationIds = []; + if (message.locationIds && message.locationIds.length) { + object.locationIds = []; + for (var j = 0; j < message.locationIds.length; ++j) + object.locationIds[j] = message.locationIds[j]; + } + return object; + }; + + /** + * Converts this LocationIdSet to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @instance + * @returns {Object.} JSON object + */ + LocationIdSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationIdSet + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationIdSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.LocationIdSet"; + }; + + return LocationIdSet; + })(); + + v1beta.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IRow + * @property {Array.|null} [cells] Row cells + */ + + /** + * Constructs a new Row. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.cells = []; + 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]]; + } + + /** + * Row cells. + * @member {Array.} cells + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @instance + */ + Row.prototype.cells = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRow=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Row.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cells != null && message.cells.length) + for (var i = 0; i < message.cells.length; ++i) + $root.google.shopping.merchant.accounts.v1beta.Value.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @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.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.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.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.cells && message.cells.length)) + message.cells = []; + message.cells.push($root.google.shopping.merchant.accounts.v1beta.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cells != null && message.hasOwnProperty("cells")) { + if (!Array.isArray(message.cells)) + return "cells: array expected"; + for (var i = 0; i < message.cells.length; ++i) { + var error = $root.google.shopping.merchant.accounts.v1beta.Value.verify(message.cells[i]); + if (error) + return "cells." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Row) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Row(); + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".google.shopping.merchant.accounts.v1beta.Row.cells: array expected"); + message.cells = []; + for (var i = 0; i < object.cells.length; ++i) { + if (typeof object.cells[i] !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Row.cells: object expected"); + message.cells[i] = $root.google.shopping.merchant.accounts.v1beta.Value.fromObject(object.cells[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @static + * @param {google.shopping.merchant.accounts.v1beta.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cells = []; + if (message.cells && message.cells.length) { + object.cells = []; + for (var j = 0; j < message.cells.length; ++j) + object.cells[j] = $root.google.shopping.merchant.accounts.v1beta.Value.toObject(message.cells[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Row"; + }; + + return Row; + })(); + + v1beta.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IValue + * @property {boolean|null} [noShipping] Value noShipping + * @property {google.shopping.type.IPrice|null} [flatRate] Value flatRate + * @property {string|null} [pricePercentage] Value pricePercentage + * @property {string|null} [carrierRate] Value carrierRate + * @property {string|null} [subtable] Value subtable + */ + + /** + * Constructs a new Value. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value noShipping. + * @member {boolean|null|undefined} noShipping + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Value.prototype.noShipping = null; + + /** + * Value flatRate. + * @member {google.shopping.type.IPrice|null|undefined} flatRate + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Value.prototype.flatRate = null; + + /** + * Value pricePercentage. + * @member {string|null|undefined} pricePercentage + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Value.prototype.pricePercentage = null; + + /** + * Value carrierRate. + * @member {string|null|undefined} carrierRate + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Value.prototype.carrierRate = null; + + /** + * Value subtable. + * @member {string|null|undefined} subtable + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Value.prototype.subtable = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value _noShipping. + * @member {"noShipping"|undefined} _noShipping + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Object.defineProperty(Value.prototype, "_noShipping", { + get: $util.oneOfGetter($oneOfFields = ["noShipping"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Value _flatRate. + * @member {"flatRate"|undefined} _flatRate + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Object.defineProperty(Value.prototype, "_flatRate", { + get: $util.oneOfGetter($oneOfFields = ["flatRate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Value _pricePercentage. + * @member {"pricePercentage"|undefined} _pricePercentage + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Object.defineProperty(Value.prototype, "_pricePercentage", { + get: $util.oneOfGetter($oneOfFields = ["pricePercentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Value _carrierRate. + * @member {"carrierRate"|undefined} _carrierRate + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Object.defineProperty(Value.prototype, "_carrierRate", { + get: $util.oneOfGetter($oneOfFields = ["carrierRate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Value _subtable. + * @member {"subtable"|undefined} _subtable + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + */ + Object.defineProperty(Value.prototype, "_subtable", { + get: $util.oneOfGetter($oneOfFields = ["subtable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @static + * @param {google.shopping.merchant.accounts.v1beta.IValue=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Value.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @static + * @param {google.shopping.merchant.accounts.v1beta.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.noShipping != null && Object.hasOwnProperty.call(message, "noShipping")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.noShipping); + if (message.flatRate != null && Object.hasOwnProperty.call(message, "flatRate")) + $root.google.shopping.type.Price.encode(message.flatRate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pricePercentage != null && Object.hasOwnProperty.call(message, "pricePercentage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pricePercentage); + if (message.carrierRate != null && Object.hasOwnProperty.call(message, "carrierRate")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.carrierRate); + if (message.subtable != null && Object.hasOwnProperty.call(message, "subtable")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.subtable); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @static + * @param {google.shopping.merchant.accounts.v1beta.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @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.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.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.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.noShipping = reader.bool(); + break; + } + case 2: { + message.flatRate = $root.google.shopping.type.Price.decode(reader, reader.uint32()); + break; + } + case 3: { + message.pricePercentage = reader.string(); + break; + } + case 4: { + message.carrierRate = reader.string(); + break; + } + case 5: { + message.subtable = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.noShipping != null && message.hasOwnProperty("noShipping")) { + properties._noShipping = 1; + if (typeof message.noShipping !== "boolean") + return "noShipping: boolean expected"; + } + if (message.flatRate != null && message.hasOwnProperty("flatRate")) { + properties._flatRate = 1; + { + var error = $root.google.shopping.type.Price.verify(message.flatRate); + if (error) + return "flatRate." + error; + } + } + if (message.pricePercentage != null && message.hasOwnProperty("pricePercentage")) { + properties._pricePercentage = 1; + if (!$util.isString(message.pricePercentage)) + return "pricePercentage: string expected"; + } + if (message.carrierRate != null && message.hasOwnProperty("carrierRate")) { + properties._carrierRate = 1; + if (!$util.isString(message.carrierRate)) + return "carrierRate: string expected"; + } + if (message.subtable != null && message.hasOwnProperty("subtable")) { + properties._subtable = 1; + if (!$util.isString(message.subtable)) + return "subtable: string expected"; + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Value) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Value(); + if (object.noShipping != null) + message.noShipping = Boolean(object.noShipping); + if (object.flatRate != null) { + if (typeof object.flatRate !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Value.flatRate: object expected"); + message.flatRate = $root.google.shopping.type.Price.fromObject(object.flatRate); + } + if (object.pricePercentage != null) + message.pricePercentage = String(object.pricePercentage); + if (object.carrierRate != null) + message.carrierRate = String(object.carrierRate); + if (object.subtable != null) + message.subtable = String(object.subtable); + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @static + * @param {google.shopping.merchant.accounts.v1beta.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.noShipping != null && message.hasOwnProperty("noShipping")) { + object.noShipping = message.noShipping; + if (options.oneofs) + object._noShipping = "noShipping"; + } + if (message.flatRate != null && message.hasOwnProperty("flatRate")) { + object.flatRate = $root.google.shopping.type.Price.toObject(message.flatRate, options); + if (options.oneofs) + object._flatRate = "flatRate"; + } + if (message.pricePercentage != null && message.hasOwnProperty("pricePercentage")) { + object.pricePercentage = message.pricePercentage; + if (options.oneofs) + object._pricePercentage = "pricePercentage"; + } + if (message.carrierRate != null && message.hasOwnProperty("carrierRate")) { + object.carrierRate = message.carrierRate; + if (options.oneofs) + object._carrierRate = "carrierRate"; + } + if (message.subtable != null && message.hasOwnProperty("subtable")) { + object.subtable = message.subtable; + if (options.oneofs) + object._subtable = "subtable"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Value"; + }; + + return Value; + })(); + + v1beta.CarrierRate = (function() { + + /** + * Properties of a CarrierRate. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ICarrierRate + * @property {string|null} [name] CarrierRate name + * @property {string|null} [carrier] CarrierRate carrier + * @property {string|null} [carrierService] CarrierRate carrierService + * @property {string|null} [originPostalCode] CarrierRate originPostalCode + * @property {string|null} [percentageAdjustment] CarrierRate percentageAdjustment + * @property {google.shopping.type.IPrice|null} [flatAdjustment] CarrierRate flatAdjustment + */ + + /** + * Constructs a new CarrierRate. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a CarrierRate. + * @implements ICarrierRate + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ICarrierRate=} [properties] Properties to set + */ + function CarrierRate(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]]; + } + + /** + * CarrierRate name. + * @member {string|null|undefined} name + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + CarrierRate.prototype.name = null; + + /** + * CarrierRate carrier. + * @member {string|null|undefined} carrier + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + CarrierRate.prototype.carrier = null; + + /** + * CarrierRate carrierService. + * @member {string|null|undefined} carrierService + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + CarrierRate.prototype.carrierService = null; + + /** + * CarrierRate originPostalCode. + * @member {string|null|undefined} originPostalCode + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + CarrierRate.prototype.originPostalCode = null; + + /** + * CarrierRate percentageAdjustment. + * @member {string|null|undefined} percentageAdjustment + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + CarrierRate.prototype.percentageAdjustment = null; + + /** + * CarrierRate flatAdjustment. + * @member {google.shopping.type.IPrice|null|undefined} flatAdjustment + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + CarrierRate.prototype.flatAdjustment = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CarrierRate _name. + * @member {"name"|undefined} _name + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + Object.defineProperty(CarrierRate.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CarrierRate _carrier. + * @member {"carrier"|undefined} _carrier + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + Object.defineProperty(CarrierRate.prototype, "_carrier", { + get: $util.oneOfGetter($oneOfFields = ["carrier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CarrierRate _carrierService. + * @member {"carrierService"|undefined} _carrierService + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + Object.defineProperty(CarrierRate.prototype, "_carrierService", { + get: $util.oneOfGetter($oneOfFields = ["carrierService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CarrierRate _originPostalCode. + * @member {"originPostalCode"|undefined} _originPostalCode + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + Object.defineProperty(CarrierRate.prototype, "_originPostalCode", { + get: $util.oneOfGetter($oneOfFields = ["originPostalCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CarrierRate _percentageAdjustment. + * @member {"percentageAdjustment"|undefined} _percentageAdjustment + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + Object.defineProperty(CarrierRate.prototype, "_percentageAdjustment", { + get: $util.oneOfGetter($oneOfFields = ["percentageAdjustment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CarrierRate _flatAdjustment. + * @member {"flatAdjustment"|undefined} _flatAdjustment + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + */ + Object.defineProperty(CarrierRate.prototype, "_flatAdjustment", { + get: $util.oneOfGetter($oneOfFields = ["flatAdjustment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CarrierRate instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICarrierRate=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.CarrierRate} CarrierRate instance + */ + CarrierRate.create = function create(properties) { + return new CarrierRate(properties); + }; + + /** + * Encodes the specified CarrierRate message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CarrierRate.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICarrierRate} message CarrierRate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CarrierRate.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.carrier != null && Object.hasOwnProperty.call(message, "carrier")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.carrier); + if (message.carrierService != null && Object.hasOwnProperty.call(message, "carrierService")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.carrierService); + if (message.originPostalCode != null && Object.hasOwnProperty.call(message, "originPostalCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.originPostalCode); + if (message.percentageAdjustment != null && Object.hasOwnProperty.call(message, "percentageAdjustment")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.percentageAdjustment); + if (message.flatAdjustment != null && Object.hasOwnProperty.call(message, "flatAdjustment")) + $root.google.shopping.type.Price.encode(message.flatAdjustment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CarrierRate message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CarrierRate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @static + * @param {google.shopping.merchant.accounts.v1beta.ICarrierRate} message CarrierRate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CarrierRate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CarrierRate message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @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.CarrierRate} CarrierRate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CarrierRate.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.CarrierRate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.carrier = reader.string(); + break; + } + case 3: { + message.carrierService = reader.string(); + break; + } + case 4: { + message.originPostalCode = reader.string(); + break; + } + case 5: { + message.percentageAdjustment = reader.string(); + break; + } + case 6: { + message.flatAdjustment = $root.google.shopping.type.Price.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CarrierRate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.CarrierRate} CarrierRate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CarrierRate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CarrierRate message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CarrierRate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.carrier != null && message.hasOwnProperty("carrier")) { + properties._carrier = 1; + if (!$util.isString(message.carrier)) + return "carrier: string expected"; + } + if (message.carrierService != null && message.hasOwnProperty("carrierService")) { + properties._carrierService = 1; + if (!$util.isString(message.carrierService)) + return "carrierService: string expected"; + } + if (message.originPostalCode != null && message.hasOwnProperty("originPostalCode")) { + properties._originPostalCode = 1; + if (!$util.isString(message.originPostalCode)) + return "originPostalCode: string expected"; + } + if (message.percentageAdjustment != null && message.hasOwnProperty("percentageAdjustment")) { + properties._percentageAdjustment = 1; + if (!$util.isString(message.percentageAdjustment)) + return "percentageAdjustment: string expected"; + } + if (message.flatAdjustment != null && message.hasOwnProperty("flatAdjustment")) { + properties._flatAdjustment = 1; + { + var error = $root.google.shopping.type.Price.verify(message.flatAdjustment); + if (error) + return "flatAdjustment." + error; + } + } + return null; + }; + + /** + * Creates a CarrierRate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.CarrierRate} CarrierRate + */ + CarrierRate.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CarrierRate) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.CarrierRate(); + if (object.name != null) + message.name = String(object.name); + if (object.carrier != null) + message.carrier = String(object.carrier); + if (object.carrierService != null) + message.carrierService = String(object.carrierService); + if (object.originPostalCode != null) + message.originPostalCode = String(object.originPostalCode); + if (object.percentageAdjustment != null) + message.percentageAdjustment = String(object.percentageAdjustment); + if (object.flatAdjustment != null) { + if (typeof object.flatAdjustment !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.CarrierRate.flatAdjustment: object expected"); + message.flatAdjustment = $root.google.shopping.type.Price.fromObject(object.flatAdjustment); + } + return message; + }; + + /** + * Creates a plain object from a CarrierRate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @static + * @param {google.shopping.merchant.accounts.v1beta.CarrierRate} message CarrierRate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CarrierRate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.carrier != null && message.hasOwnProperty("carrier")) { + object.carrier = message.carrier; + if (options.oneofs) + object._carrier = "carrier"; + } + if (message.carrierService != null && message.hasOwnProperty("carrierService")) { + object.carrierService = message.carrierService; + if (options.oneofs) + object._carrierService = "carrierService"; + } + if (message.originPostalCode != null && message.hasOwnProperty("originPostalCode")) { + object.originPostalCode = message.originPostalCode; + if (options.oneofs) + object._originPostalCode = "originPostalCode"; + } + if (message.percentageAdjustment != null && message.hasOwnProperty("percentageAdjustment")) { + object.percentageAdjustment = message.percentageAdjustment; + if (options.oneofs) + object._percentageAdjustment = "percentageAdjustment"; + } + if (message.flatAdjustment != null && message.hasOwnProperty("flatAdjustment")) { + object.flatAdjustment = $root.google.shopping.type.Price.toObject(message.flatAdjustment, options); + if (options.oneofs) + object._flatAdjustment = "flatAdjustment"; + } + return object; + }; + + /** + * Converts this CarrierRate to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @instance + * @returns {Object.} JSON object + */ + CarrierRate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CarrierRate + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CarrierRate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CarrierRate"; + }; + + return CarrierRate; + })(); + + v1beta.GetShippingSettingsRequest = (function() { + + /** + * Properties of a GetShippingSettingsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetShippingSettingsRequest + * @property {string|null} [name] GetShippingSettingsRequest name + */ + + /** + * Constructs a new GetShippingSettingsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetShippingSettingsRequest. + * @implements IGetShippingSettingsRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest=} [properties] Properties to set + */ + function GetShippingSettingsRequest(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]]; + } + + /** + * GetShippingSettingsRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @instance + */ + GetShippingSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetShippingSettingsRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest} GetShippingSettingsRequest instance + */ + GetShippingSettingsRequest.create = function create(properties) { + return new GetShippingSettingsRequest(properties); + }; + + /** + * Encodes the specified GetShippingSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest} message GetShippingSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetShippingSettingsRequest.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 GetShippingSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest} message GetShippingSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetShippingSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetShippingSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @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.GetShippingSettingsRequest} GetShippingSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetShippingSettingsRequest.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.GetShippingSettingsRequest(); + 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 GetShippingSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest} GetShippingSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetShippingSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetShippingSettingsRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetShippingSettingsRequest.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 GetShippingSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest} GetShippingSettingsRequest + */ + GetShippingSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetShippingSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest} message GetShippingSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetShippingSettingsRequest.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 GetShippingSettingsRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetShippingSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetShippingSettingsRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetShippingSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest"; + }; + + return GetShippingSettingsRequest; + })(); + + v1beta.InsertShippingSettingsRequest = (function() { + + /** + * Properties of an InsertShippingSettingsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IInsertShippingSettingsRequest + * @property {string|null} [parent] InsertShippingSettingsRequest parent + * @property {google.shopping.merchant.accounts.v1beta.IShippingSettings|null} [shippingSetting] InsertShippingSettingsRequest shippingSetting + */ + + /** + * Constructs a new InsertShippingSettingsRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an InsertShippingSettingsRequest. + * @implements IInsertShippingSettingsRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest=} [properties] Properties to set + */ + function InsertShippingSettingsRequest(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]]; + } + + /** + * InsertShippingSettingsRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @instance + */ + InsertShippingSettingsRequest.prototype.parent = ""; + + /** + * InsertShippingSettingsRequest shippingSetting. + * @member {google.shopping.merchant.accounts.v1beta.IShippingSettings|null|undefined} shippingSetting + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @instance + */ + InsertShippingSettingsRequest.prototype.shippingSetting = null; + + /** + * Creates a new InsertShippingSettingsRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest} InsertShippingSettingsRequest instance + */ + InsertShippingSettingsRequest.create = function create(properties) { + return new InsertShippingSettingsRequest(properties); + }; + + /** + * Encodes the specified InsertShippingSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest} message InsertShippingSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertShippingSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.shippingSetting != null && Object.hasOwnProperty.call(message, "shippingSetting")) + $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.encode(message.shippingSetting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertShippingSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest} message InsertShippingSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertShippingSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertShippingSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @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.InsertShippingSettingsRequest} InsertShippingSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertShippingSettingsRequest.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.InsertShippingSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.shippingSetting = $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertShippingSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest} InsertShippingSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertShippingSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertShippingSettingsRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertShippingSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.shippingSetting != null && message.hasOwnProperty("shippingSetting")) { + var error = $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.verify(message.shippingSetting); + if (error) + return "shippingSetting." + error; + } + return null; + }; + + /** + * Creates an InsertShippingSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest} InsertShippingSettingsRequest + */ + InsertShippingSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.shippingSetting != null) { + if (typeof object.shippingSetting !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.shippingSetting: object expected"); + message.shippingSetting = $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.fromObject(object.shippingSetting); + } + return message; + }; + + /** + * Creates a plain object from an InsertShippingSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest} message InsertShippingSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertShippingSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.shippingSetting = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.shippingSetting != null && message.hasOwnProperty("shippingSetting")) + object.shippingSetting = $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.toObject(message.shippingSetting, options); + return object; + }; + + /** + * Converts this InsertShippingSettingsRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + InsertShippingSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsertShippingSettingsRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsertShippingSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest"; + }; + + return InsertShippingSettingsRequest; + })(); + + v1beta.TermsOfServiceService = (function() { + + /** + * Constructs a new TermsOfServiceService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a TermsOfServiceService + * @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 TermsOfServiceService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TermsOfServiceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TermsOfServiceService; + + /** + * Creates new TermsOfServiceService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @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 {TermsOfServiceService} RPC service. Useful where requests and/or responses are streamed. + */ + TermsOfServiceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|getTermsOfService}. + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @typedef GetTermsOfServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.TermsOfService} [response] TermsOfService + */ + + /** + * Calls GetTermsOfService. + * @function getTermsOfService + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest} request GetTermsOfServiceRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceService.GetTermsOfServiceCallback} callback Node-style callback called with the error, if any, and TermsOfService + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TermsOfServiceService.prototype.getTermsOfService = function getTermsOfService(request, callback) { + return this.rpcCall(getTermsOfService, $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest, $root.google.shopping.merchant.accounts.v1beta.TermsOfService, request, callback); + }, "name", { value: "GetTermsOfService" }); + + /** + * Calls GetTermsOfService. + * @function getTermsOfService + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest} request GetTermsOfServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|retrieveLatestTermsOfService}. + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @typedef RetrieveLatestTermsOfServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.TermsOfService} [response] TermsOfService + */ + + /** + * Calls RetrieveLatestTermsOfService. + * @function retrieveLatestTermsOfService + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest} request RetrieveLatestTermsOfServiceRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceService.RetrieveLatestTermsOfServiceCallback} callback Node-style callback called with the error, if any, and TermsOfService + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TermsOfServiceService.prototype.retrieveLatestTermsOfService = function retrieveLatestTermsOfService(request, callback) { + return this.rpcCall(retrieveLatestTermsOfService, $root.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest, $root.google.shopping.merchant.accounts.v1beta.TermsOfService, request, callback); + }, "name", { value: "RetrieveLatestTermsOfService" }); + + /** + * Calls RetrieveLatestTermsOfService. + * @function retrieveLatestTermsOfService + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest} request RetrieveLatestTermsOfServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|acceptTermsOfService}. + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @typedef AcceptTermsOfServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls AcceptTermsOfService. + * @function acceptTermsOfService + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest} request AcceptTermsOfServiceRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceService.AcceptTermsOfServiceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TermsOfServiceService.prototype.acceptTermsOfService = function acceptTermsOfService(request, callback) { + return this.rpcCall(acceptTermsOfService, $root.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "AcceptTermsOfService" }); + + /** + * Calls AcceptTermsOfService. + * @function acceptTermsOfService + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest} request AcceptTermsOfServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TermsOfServiceService; + })(); + + v1beta.TermsOfService = (function() { + + /** + * Properties of a TermsOfService. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ITermsOfService + * @property {string|null} [name] TermsOfService name + * @property {string|null} [regionCode] TermsOfService regionCode + * @property {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null} [kind] TermsOfService kind + * @property {string|null} [fileUri] TermsOfService fileUri + * @property {boolean|null} [external] TermsOfService external + */ + + /** + * Constructs a new TermsOfService. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a TermsOfService. + * @implements ITermsOfService + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ITermsOfService=} [properties] Properties to set + */ + function TermsOfService(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TermsOfService name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @instance + */ + TermsOfService.prototype.name = ""; + + /** + * TermsOfService regionCode. + * @member {string} regionCode + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @instance + */ + TermsOfService.prototype.regionCode = ""; + + /** + * TermsOfService kind. + * @member {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind} kind + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @instance + */ + TermsOfService.prototype.kind = 0; + + /** + * TermsOfService fileUri. + * @member {string|null|undefined} fileUri + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @instance + */ + TermsOfService.prototype.fileUri = null; + + /** + * TermsOfService external. + * @member {boolean} external + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @instance + */ + TermsOfService.prototype.external = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TermsOfService _fileUri. + * @member {"fileUri"|undefined} _fileUri + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @instance + */ + Object.defineProperty(TermsOfService.prototype, "_fileUri", { + get: $util.oneOfGetter($oneOfFields = ["fileUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TermsOfService instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITermsOfService=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.TermsOfService} TermsOfService instance + */ + TermsOfService.create = function create(properties) { + return new TermsOfService(properties); + }; + + /** + * Encodes the specified TermsOfService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfService.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITermsOfService} message TermsOfService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TermsOfService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kind); + if (message.fileUri != null && Object.hasOwnProperty.call(message, "fileUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fileUri); + if (message.external != null && Object.hasOwnProperty.call(message, "external")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.external); + return writer; + }; + + /** + * Encodes the specified TermsOfService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITermsOfService} message TermsOfService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TermsOfService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TermsOfService message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @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.TermsOfService} TermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TermsOfService.decode = function decode(reader, length) { + 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.TermsOfService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.regionCode = reader.string(); + break; + } + case 3: { + message.kind = reader.int32(); + break; + } + case 4: { + message.fileUri = reader.string(); + break; + } + case 5: { + message.external = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TermsOfService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.TermsOfService} TermsOfService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TermsOfService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TermsOfService message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TermsOfService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + break; + } + if (message.fileUri != null && message.hasOwnProperty("fileUri")) { + properties._fileUri = 1; + if (!$util.isString(message.fileUri)) + return "fileUri: string expected"; + } + if (message.external != null && message.hasOwnProperty("external")) + if (typeof message.external !== "boolean") + return "external: boolean expected"; + return null; + }; + + /** + * Creates a TermsOfService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.TermsOfService} TermsOfService + */ + TermsOfService.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TermsOfService) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.TermsOfService(); + if (object.name != null) + message.name = String(object.name); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "TERMS_OF_SERVICE_KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "MERCHANT_CENTER": + case 1: + message.kind = 1; + break; + } + if (object.fileUri != null) + message.fileUri = String(object.fileUri); + if (object.external != null) + message.external = Boolean(object.external); + return message; + }; + + /** + * Creates a plain object from a TermsOfService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @static + * @param {google.shopping.merchant.accounts.v1beta.TermsOfService} message TermsOfService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TermsOfService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.regionCode = ""; + object.kind = options.enums === String ? "TERMS_OF_SERVICE_KIND_UNSPECIFIED" : 0; + object.external = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.kind] === undefined ? message.kind : $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.kind] : message.kind; + if (message.fileUri != null && message.hasOwnProperty("fileUri")) { + object.fileUri = message.fileUri; + if (options.oneofs) + object._fileUri = "fileUri"; + } + if (message.external != null && message.hasOwnProperty("external")) + object.external = message.external; + return object; + }; + + /** + * Converts this TermsOfService to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @instance + * @returns {Object.} JSON object + */ + TermsOfService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TermsOfService + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TermsOfService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TermsOfService"; + }; + + return TermsOfService; + })(); + + v1beta.GetTermsOfServiceRequest = (function() { + + /** + * Properties of a GetTermsOfServiceRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetTermsOfServiceRequest + * @property {string|null} [name] GetTermsOfServiceRequest name + */ + + /** + * Constructs a new GetTermsOfServiceRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetTermsOfServiceRequest. + * @implements IGetTermsOfServiceRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest=} [properties] Properties to set + */ + function GetTermsOfServiceRequest(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]]; + } + + /** + * GetTermsOfServiceRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @instance + */ + GetTermsOfServiceRequest.prototype.name = ""; + + /** + * Creates a new GetTermsOfServiceRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest} GetTermsOfServiceRequest instance + */ + GetTermsOfServiceRequest.create = function create(properties) { + return new GetTermsOfServiceRequest(properties); + }; + + /** + * Encodes the specified GetTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest} message GetTermsOfServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTermsOfServiceRequest.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 GetTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest} message GetTermsOfServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTermsOfServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTermsOfServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @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.GetTermsOfServiceRequest} GetTermsOfServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTermsOfServiceRequest.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.GetTermsOfServiceRequest(); + 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 GetTermsOfServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest} GetTermsOfServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTermsOfServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTermsOfServiceRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTermsOfServiceRequest.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 GetTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest} GetTermsOfServiceRequest + */ + GetTermsOfServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTermsOfServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest} message GetTermsOfServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTermsOfServiceRequest.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 GetTermsOfServiceRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @instance + * @returns {Object.} JSON object + */ + GetTermsOfServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTermsOfServiceRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTermsOfServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest"; + }; + + return GetTermsOfServiceRequest; + })(); + + v1beta.RetrieveLatestTermsOfServiceRequest = (function() { + + /** + * Properties of a RetrieveLatestTermsOfServiceRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IRetrieveLatestTermsOfServiceRequest + * @property {string|null} [regionCode] RetrieveLatestTermsOfServiceRequest regionCode + * @property {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null} [kind] RetrieveLatestTermsOfServiceRequest kind + */ + + /** + * Constructs a new RetrieveLatestTermsOfServiceRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a RetrieveLatestTermsOfServiceRequest. + * @implements IRetrieveLatestTermsOfServiceRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest=} [properties] Properties to set + */ + function RetrieveLatestTermsOfServiceRequest(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]]; + } + + /** + * RetrieveLatestTermsOfServiceRequest regionCode. + * @member {string} regionCode + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @instance + */ + RetrieveLatestTermsOfServiceRequest.prototype.regionCode = ""; + + /** + * RetrieveLatestTermsOfServiceRequest kind. + * @member {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind} kind + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @instance + */ + RetrieveLatestTermsOfServiceRequest.prototype.kind = 0; + + /** + * Creates a new RetrieveLatestTermsOfServiceRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest} RetrieveLatestTermsOfServiceRequest instance + */ + RetrieveLatestTermsOfServiceRequest.create = function create(properties) { + return new RetrieveLatestTermsOfServiceRequest(properties); + }; + + /** + * Encodes the specified RetrieveLatestTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest} message RetrieveLatestTermsOfServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveLatestTermsOfServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.kind); + return writer; + }; + + /** + * Encodes the specified RetrieveLatestTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest} message RetrieveLatestTermsOfServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveLatestTermsOfServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveLatestTermsOfServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @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.RetrieveLatestTermsOfServiceRequest} RetrieveLatestTermsOfServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveLatestTermsOfServiceRequest.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.RetrieveLatestTermsOfServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.regionCode = reader.string(); + break; + } + case 2: { + message.kind = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveLatestTermsOfServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest} RetrieveLatestTermsOfServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveLatestTermsOfServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveLatestTermsOfServiceRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveLatestTermsOfServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a RetrieveLatestTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest} RetrieveLatestTermsOfServiceRequest + */ + RetrieveLatestTermsOfServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest(); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "TERMS_OF_SERVICE_KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "MERCHANT_CENTER": + case 1: + message.kind = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a RetrieveLatestTermsOfServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest} message RetrieveLatestTermsOfServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveLatestTermsOfServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionCode = ""; + object.kind = options.enums === String ? "TERMS_OF_SERVICE_KIND_UNSPECIFIED" : 0; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.kind] === undefined ? message.kind : $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.kind] : message.kind; + return object; + }; + + /** + * Converts this RetrieveLatestTermsOfServiceRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @instance + * @returns {Object.} JSON object + */ + RetrieveLatestTermsOfServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveLatestTermsOfServiceRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveLatestTermsOfServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest"; + }; + + return RetrieveLatestTermsOfServiceRequest; + })(); + + v1beta.AcceptTermsOfServiceRequest = (function() { + + /** + * Properties of an AcceptTermsOfServiceRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IAcceptTermsOfServiceRequest + * @property {string|null} [name] AcceptTermsOfServiceRequest name + * @property {string|null} [account] AcceptTermsOfServiceRequest account + * @property {string|null} [regionCode] AcceptTermsOfServiceRequest regionCode + */ + + /** + * Constructs a new AcceptTermsOfServiceRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an AcceptTermsOfServiceRequest. + * @implements IAcceptTermsOfServiceRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest=} [properties] Properties to set + */ + function AcceptTermsOfServiceRequest(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]]; + } + + /** + * AcceptTermsOfServiceRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @instance + */ + AcceptTermsOfServiceRequest.prototype.name = ""; + + /** + * AcceptTermsOfServiceRequest account. + * @member {string} account + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @instance + */ + AcceptTermsOfServiceRequest.prototype.account = ""; + + /** + * AcceptTermsOfServiceRequest regionCode. + * @member {string} regionCode + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @instance + */ + AcceptTermsOfServiceRequest.prototype.regionCode = ""; + + /** + * Creates a new AcceptTermsOfServiceRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest} AcceptTermsOfServiceRequest instance + */ + AcceptTermsOfServiceRequest.create = function create(properties) { + return new AcceptTermsOfServiceRequest(properties); + }; + + /** + * Encodes the specified AcceptTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest} message AcceptTermsOfServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceptTermsOfServiceRequest.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.account != null && Object.hasOwnProperty.call(message, "account")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.account); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.regionCode); + return writer; + }; + + /** + * Encodes the specified AcceptTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest} message AcceptTermsOfServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceptTermsOfServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceptTermsOfServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @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.AcceptTermsOfServiceRequest} AcceptTermsOfServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceptTermsOfServiceRequest.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.AcceptTermsOfServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.account = reader.string(); + break; + } + case 3: { + message.regionCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceptTermsOfServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest} AcceptTermsOfServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceptTermsOfServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceptTermsOfServiceRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceptTermsOfServiceRequest.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.account != null && message.hasOwnProperty("account")) + if (!$util.isString(message.account)) + return "account: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + return null; + }; + + /** + * Creates an AcceptTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest} AcceptTermsOfServiceRequest + */ + AcceptTermsOfServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.account != null) + message.account = String(object.account); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + return message; + }; + + /** + * Creates a plain object from an AcceptTermsOfServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest} message AcceptTermsOfServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceptTermsOfServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.account = ""; + object.regionCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.account != null && message.hasOwnProperty("account")) + object.account = message.account; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + return object; + }; + + /** + * Converts this AcceptTermsOfServiceRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @instance + * @returns {Object.} JSON object + */ + AcceptTermsOfServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcceptTermsOfServiceRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcceptTermsOfServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest"; + }; + + return AcceptTermsOfServiceRequest; + })(); + + /** + * TermsOfServiceKind enum. + * @name google.shopping.merchant.accounts.v1beta.TermsOfServiceKind + * @enum {number} + * @property {number} TERMS_OF_SERVICE_KIND_UNSPECIFIED=0 TERMS_OF_SERVICE_KIND_UNSPECIFIED value + * @property {number} MERCHANT_CENTER=1 MERCHANT_CENTER value + */ + v1beta.TermsOfServiceKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TERMS_OF_SERVICE_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "MERCHANT_CENTER"] = 1; + return values; + })(); + + v1beta.TermsOfServiceAgreementStateService = (function() { + + /** + * Constructs a new TermsOfServiceAgreementStateService service. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a TermsOfServiceAgreementStateService + * @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 TermsOfServiceAgreementStateService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TermsOfServiceAgreementStateService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TermsOfServiceAgreementStateService; + + /** + * Creates new TermsOfServiceAgreementStateService service using the specified rpc implementation. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService + * @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 {TermsOfServiceAgreementStateService} RPC service. Useful where requests and/or responses are streamed. + */ + TermsOfServiceAgreementStateService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService|getTermsOfServiceAgreementState}. + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService + * @typedef GetTermsOfServiceAgreementStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} [response] TermsOfServiceAgreementState + */ + + /** + * Calls GetTermsOfServiceAgreementState. + * @function getTermsOfServiceAgreementState + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest} request GetTermsOfServiceAgreementStateRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.GetTermsOfServiceAgreementStateCallback} callback Node-style callback called with the error, if any, and TermsOfServiceAgreementState + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TermsOfServiceAgreementStateService.prototype.getTermsOfServiceAgreementState = function getTermsOfServiceAgreementState(request, callback) { + return this.rpcCall(getTermsOfServiceAgreementState, $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest, $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState, request, callback); + }, "name", { value: "GetTermsOfServiceAgreementState" }); + + /** + * Calls GetTermsOfServiceAgreementState. + * @function getTermsOfServiceAgreementState + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest} request GetTermsOfServiceAgreementStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService|retrieveForApplicationTermsOfServiceAgreementState}. + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService + * @typedef RetrieveForApplicationTermsOfServiceAgreementStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} [response] TermsOfServiceAgreementState + */ + + /** + * Calls RetrieveForApplicationTermsOfServiceAgreementState. + * @function retrieveForApplicationTermsOfServiceAgreementState + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest} request RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object + * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.RetrieveForApplicationTermsOfServiceAgreementStateCallback} callback Node-style callback called with the error, if any, and TermsOfServiceAgreementState + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TermsOfServiceAgreementStateService.prototype.retrieveForApplicationTermsOfServiceAgreementState = function retrieveForApplicationTermsOfServiceAgreementState(request, callback) { + return this.rpcCall(retrieveForApplicationTermsOfServiceAgreementState, $root.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest, $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState, request, callback); + }, "name", { value: "RetrieveForApplicationTermsOfServiceAgreementState" }); + + /** + * Calls RetrieveForApplicationTermsOfServiceAgreementState. + * @function retrieveForApplicationTermsOfServiceAgreementState + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService + * @instance + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest} request RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TermsOfServiceAgreementStateService; + })(); + + v1beta.TermsOfServiceAgreementState = (function() { + + /** + * Properties of a TermsOfServiceAgreementState. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface ITermsOfServiceAgreementState + * @property {string|null} [name] TermsOfServiceAgreementState name + * @property {string|null} [regionCode] TermsOfServiceAgreementState regionCode + * @property {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null} [termsOfServiceKind] TermsOfServiceAgreementState termsOfServiceKind + * @property {google.shopping.merchant.accounts.v1beta.IAccepted|null} [accepted] TermsOfServiceAgreementState accepted + * @property {google.shopping.merchant.accounts.v1beta.IRequired|null} [required] TermsOfServiceAgreementState required + */ + + /** + * Constructs a new TermsOfServiceAgreementState. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a TermsOfServiceAgreementState. + * @implements ITermsOfServiceAgreementState + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState=} [properties] Properties to set + */ + function TermsOfServiceAgreementState(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]]; + } + + /** + * TermsOfServiceAgreementState name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @instance + */ + TermsOfServiceAgreementState.prototype.name = ""; + + /** + * TermsOfServiceAgreementState regionCode. + * @member {string} regionCode + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @instance + */ + TermsOfServiceAgreementState.prototype.regionCode = ""; + + /** + * TermsOfServiceAgreementState termsOfServiceKind. + * @member {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind} termsOfServiceKind + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @instance + */ + TermsOfServiceAgreementState.prototype.termsOfServiceKind = 0; + + /** + * TermsOfServiceAgreementState accepted. + * @member {google.shopping.merchant.accounts.v1beta.IAccepted|null|undefined} accepted + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @instance + */ + TermsOfServiceAgreementState.prototype.accepted = null; + + /** + * TermsOfServiceAgreementState required. + * @member {google.shopping.merchant.accounts.v1beta.IRequired|null|undefined} required + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @instance + */ + TermsOfServiceAgreementState.prototype.required = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TermsOfServiceAgreementState _accepted. + * @member {"accepted"|undefined} _accepted + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @instance + */ + Object.defineProperty(TermsOfServiceAgreementState.prototype, "_accepted", { + get: $util.oneOfGetter($oneOfFields = ["accepted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TermsOfServiceAgreementState _required. + * @member {"required"|undefined} _required + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @instance + */ + Object.defineProperty(TermsOfServiceAgreementState.prototype, "_required", { + get: $util.oneOfGetter($oneOfFields = ["required"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TermsOfServiceAgreementState instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} TermsOfServiceAgreementState instance + */ + TermsOfServiceAgreementState.create = function create(properties) { + return new TermsOfServiceAgreementState(properties); + }; + + /** + * Encodes the specified TermsOfServiceAgreementState message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState} message TermsOfServiceAgreementState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TermsOfServiceAgreementState.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.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.termsOfServiceKind != null && Object.hasOwnProperty.call(message, "termsOfServiceKind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.termsOfServiceKind); + if (message.accepted != null && Object.hasOwnProperty.call(message, "accepted")) + $root.google.shopping.merchant.accounts.v1beta.Accepted.encode(message.accepted, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + $root.google.shopping.merchant.accounts.v1beta.Required.encode(message.required, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TermsOfServiceAgreementState message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @static + * @param {google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState} message TermsOfServiceAgreementState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TermsOfServiceAgreementState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TermsOfServiceAgreementState message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @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.TermsOfServiceAgreementState} TermsOfServiceAgreementState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TermsOfServiceAgreementState.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.TermsOfServiceAgreementState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.regionCode = reader.string(); + break; + } + case 3: { + message.termsOfServiceKind = reader.int32(); + break; + } + case 4: { + message.accepted = $root.google.shopping.merchant.accounts.v1beta.Accepted.decode(reader, reader.uint32()); + break; + } + case 5: { + message.required = $root.google.shopping.merchant.accounts.v1beta.Required.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TermsOfServiceAgreementState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} TermsOfServiceAgreementState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TermsOfServiceAgreementState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TermsOfServiceAgreementState message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TermsOfServiceAgreementState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.termsOfServiceKind != null && message.hasOwnProperty("termsOfServiceKind")) + switch (message.termsOfServiceKind) { + default: + return "termsOfServiceKind: enum value expected"; + case 0: + case 1: + break; + } + if (message.accepted != null && message.hasOwnProperty("accepted")) { + properties._accepted = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Accepted.verify(message.accepted); + if (error) + return "accepted." + error; + } + } + if (message.required != null && message.hasOwnProperty("required")) { + properties._required = 1; + { + var error = $root.google.shopping.merchant.accounts.v1beta.Required.verify(message.required); + if (error) + return "required." + error; + } + } + return null; + }; + + /** + * Creates a TermsOfServiceAgreementState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} TermsOfServiceAgreementState + */ + TermsOfServiceAgreementState.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState(); + if (object.name != null) + message.name = String(object.name); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + switch (object.termsOfServiceKind) { + default: + if (typeof object.termsOfServiceKind === "number") { + message.termsOfServiceKind = object.termsOfServiceKind; + break; + } + break; + case "TERMS_OF_SERVICE_KIND_UNSPECIFIED": + case 0: + message.termsOfServiceKind = 0; + break; + case "MERCHANT_CENTER": + case 1: + message.termsOfServiceKind = 1; + break; + } + if (object.accepted != null) { + if (typeof object.accepted !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.accepted: object expected"); + message.accepted = $root.google.shopping.merchant.accounts.v1beta.Accepted.fromObject(object.accepted); + } + if (object.required != null) { + if (typeof object.required !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.required: object expected"); + message.required = $root.google.shopping.merchant.accounts.v1beta.Required.fromObject(object.required); + } + return message; + }; + + /** + * Creates a plain object from a TermsOfServiceAgreementState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @static + * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} message TermsOfServiceAgreementState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TermsOfServiceAgreementState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.regionCode = ""; + object.termsOfServiceKind = options.enums === String ? "TERMS_OF_SERVICE_KIND_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.termsOfServiceKind != null && message.hasOwnProperty("termsOfServiceKind")) + object.termsOfServiceKind = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.termsOfServiceKind] === undefined ? message.termsOfServiceKind : $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.termsOfServiceKind] : message.termsOfServiceKind; + if (message.accepted != null && message.hasOwnProperty("accepted")) { + object.accepted = $root.google.shopping.merchant.accounts.v1beta.Accepted.toObject(message.accepted, options); + if (options.oneofs) + object._accepted = "accepted"; + } + if (message.required != null && message.hasOwnProperty("required")) { + object.required = $root.google.shopping.merchant.accounts.v1beta.Required.toObject(message.required, options); + if (options.oneofs) + object._required = "required"; + } + return object; + }; + + /** + * Converts this TermsOfServiceAgreementState to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @instance + * @returns {Object.} JSON object + */ + TermsOfServiceAgreementState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TermsOfServiceAgreementState + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TermsOfServiceAgreementState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState"; + }; + + return TermsOfServiceAgreementState; + })(); + + v1beta.Accepted = (function() { + + /** + * Properties of an Accepted. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IAccepted + * @property {string|null} [termsOfService] Accepted termsOfService + * @property {string|null} [acceptedBy] Accepted acceptedBy + * @property {google.type.IDate|null} [validUntil] Accepted validUntil + */ + + /** + * Constructs a new Accepted. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents an Accepted. + * @implements IAccepted + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IAccepted=} [properties] Properties to set + */ + function Accepted(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]]; + } + + /** + * Accepted termsOfService. + * @member {string} termsOfService + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @instance + */ + Accepted.prototype.termsOfService = ""; + + /** + * Accepted acceptedBy. + * @member {string} acceptedBy + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @instance + */ + Accepted.prototype.acceptedBy = ""; + + /** + * Accepted validUntil. + * @member {google.type.IDate|null|undefined} validUntil + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @instance + */ + Accepted.prototype.validUntil = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Accepted _validUntil. + * @member {"validUntil"|undefined} _validUntil + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @instance + */ + Object.defineProperty(Accepted.prototype, "_validUntil", { + get: $util.oneOfGetter($oneOfFields = ["validUntil"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Accepted instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccepted=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Accepted} Accepted instance + */ + Accepted.create = function create(properties) { + return new Accepted(properties); + }; + + /** + * Encodes the specified Accepted message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Accepted.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccepted} message Accepted message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accepted.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.termsOfService != null && Object.hasOwnProperty.call(message, "termsOfService")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.termsOfService); + if (message.acceptedBy != null && Object.hasOwnProperty.call(message, "acceptedBy")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.acceptedBy); + if (message.validUntil != null && Object.hasOwnProperty.call(message, "validUntil")) + $root.google.type.Date.encode(message.validUntil, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Accepted message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Accepted.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @static + * @param {google.shopping.merchant.accounts.v1beta.IAccepted} message Accepted message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accepted.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Accepted message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @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.Accepted} Accepted + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accepted.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.Accepted(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.termsOfService = reader.string(); + break; + } + case 2: { + message.acceptedBy = reader.string(); + break; + } + case 3: { + message.validUntil = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Accepted message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Accepted} Accepted + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accepted.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Accepted message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Accepted.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.termsOfService != null && message.hasOwnProperty("termsOfService")) + if (!$util.isString(message.termsOfService)) + return "termsOfService: string expected"; + if (message.acceptedBy != null && message.hasOwnProperty("acceptedBy")) + if (!$util.isString(message.acceptedBy)) + return "acceptedBy: string expected"; + if (message.validUntil != null && message.hasOwnProperty("validUntil")) { + properties._validUntil = 1; + { + var error = $root.google.type.Date.verify(message.validUntil); + if (error) + return "validUntil." + error; + } + } + return null; + }; + + /** + * Creates an Accepted message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Accepted} Accepted + */ + Accepted.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Accepted) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Accepted(); + if (object.termsOfService != null) + message.termsOfService = String(object.termsOfService); + if (object.acceptedBy != null) + message.acceptedBy = String(object.acceptedBy); + if (object.validUntil != null) { + if (typeof object.validUntil !== "object") + throw TypeError(".google.shopping.merchant.accounts.v1beta.Accepted.validUntil: object expected"); + message.validUntil = $root.google.type.Date.fromObject(object.validUntil); + } + return message; + }; + + /** + * Creates a plain object from an Accepted message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @static + * @param {google.shopping.merchant.accounts.v1beta.Accepted} message Accepted + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Accepted.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.termsOfService = ""; + object.acceptedBy = ""; + } + if (message.termsOfService != null && message.hasOwnProperty("termsOfService")) + object.termsOfService = message.termsOfService; + if (message.acceptedBy != null && message.hasOwnProperty("acceptedBy")) + object.acceptedBy = message.acceptedBy; + if (message.validUntil != null && message.hasOwnProperty("validUntil")) { + object.validUntil = $root.google.type.Date.toObject(message.validUntil, options); + if (options.oneofs) + object._validUntil = "validUntil"; + } + return object; + }; + + /** + * Converts this Accepted to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @instance + * @returns {Object.} JSON object + */ + Accepted.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Accepted + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Accepted + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Accepted.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Accepted"; + }; + + return Accepted; + })(); + + v1beta.Required = (function() { + + /** + * Properties of a Required. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IRequired + * @property {string|null} [termsOfService] Required termsOfService + * @property {string|null} [tosFileUri] Required tosFileUri + */ + + /** + * Constructs a new Required. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a Required. + * @implements IRequired + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IRequired=} [properties] Properties to set + */ + function Required(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]]; + } + + /** + * Required termsOfService. + * @member {string} termsOfService + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @instance + */ + Required.prototype.termsOfService = ""; + + /** + * Required tosFileUri. + * @member {string} tosFileUri + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @instance + */ + Required.prototype.tosFileUri = ""; + + /** + * Creates a new Required instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRequired=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.Required} Required instance + */ + Required.create = function create(properties) { + return new Required(properties); + }; + + /** + * Encodes the specified Required message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Required.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRequired} message Required message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Required.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.termsOfService != null && Object.hasOwnProperty.call(message, "termsOfService")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.termsOfService); + if (message.tosFileUri != null && Object.hasOwnProperty.call(message, "tosFileUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tosFileUri); + return writer; + }; + + /** + * Encodes the specified Required message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Required.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRequired} message Required message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Required.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Required message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @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.Required} Required + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Required.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.Required(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.termsOfService = reader.string(); + break; + } + case 2: { + message.tosFileUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Required message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.Required} Required + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Required.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Required message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Required.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.termsOfService != null && message.hasOwnProperty("termsOfService")) + if (!$util.isString(message.termsOfService)) + return "termsOfService: string expected"; + if (message.tosFileUri != null && message.hasOwnProperty("tosFileUri")) + if (!$util.isString(message.tosFileUri)) + return "tosFileUri: string expected"; + return null; + }; + + /** + * Creates a Required message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.Required} Required + */ + Required.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Required) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.Required(); + if (object.termsOfService != null) + message.termsOfService = String(object.termsOfService); + if (object.tosFileUri != null) + message.tosFileUri = String(object.tosFileUri); + return message; + }; + + /** + * Creates a plain object from a Required message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @static + * @param {google.shopping.merchant.accounts.v1beta.Required} message Required + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Required.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.termsOfService = ""; + object.tosFileUri = ""; + } + if (message.termsOfService != null && message.hasOwnProperty("termsOfService")) + object.termsOfService = message.termsOfService; + if (message.tosFileUri != null && message.hasOwnProperty("tosFileUri")) + object.tosFileUri = message.tosFileUri; + return object; + }; + + /** + * Converts this Required to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @instance + * @returns {Object.} JSON object + */ + Required.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Required + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.Required + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Required.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Required"; + }; + + return Required; + })(); + + v1beta.GetTermsOfServiceAgreementStateRequest = (function() { + + /** + * Properties of a GetTermsOfServiceAgreementStateRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IGetTermsOfServiceAgreementStateRequest + * @property {string|null} [name] GetTermsOfServiceAgreementStateRequest name + */ + + /** + * Constructs a new GetTermsOfServiceAgreementStateRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a GetTermsOfServiceAgreementStateRequest. + * @implements IGetTermsOfServiceAgreementStateRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest=} [properties] Properties to set + */ + function GetTermsOfServiceAgreementStateRequest(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]]; + } + + /** + * GetTermsOfServiceAgreementStateRequest name. + * @member {string} name + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @instance + */ + GetTermsOfServiceAgreementStateRequest.prototype.name = ""; + + /** + * Creates a new GetTermsOfServiceAgreementStateRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest} GetTermsOfServiceAgreementStateRequest instance + */ + GetTermsOfServiceAgreementStateRequest.create = function create(properties) { + return new GetTermsOfServiceAgreementStateRequest(properties); + }; + + /** + * Encodes the specified GetTermsOfServiceAgreementStateRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest} message GetTermsOfServiceAgreementStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTermsOfServiceAgreementStateRequest.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 GetTermsOfServiceAgreementStateRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest} message GetTermsOfServiceAgreementStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTermsOfServiceAgreementStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTermsOfServiceAgreementStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @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.GetTermsOfServiceAgreementStateRequest} GetTermsOfServiceAgreementStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTermsOfServiceAgreementStateRequest.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.GetTermsOfServiceAgreementStateRequest(); + 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 GetTermsOfServiceAgreementStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest} GetTermsOfServiceAgreementStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTermsOfServiceAgreementStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTermsOfServiceAgreementStateRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTermsOfServiceAgreementStateRequest.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 GetTermsOfServiceAgreementStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest} GetTermsOfServiceAgreementStateRequest + */ + GetTermsOfServiceAgreementStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTermsOfServiceAgreementStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest} message GetTermsOfServiceAgreementStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTermsOfServiceAgreementStateRequest.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 GetTermsOfServiceAgreementStateRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @instance + * @returns {Object.} JSON object + */ + GetTermsOfServiceAgreementStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTermsOfServiceAgreementStateRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTermsOfServiceAgreementStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest"; + }; + + return GetTermsOfServiceAgreementStateRequest; + })(); + + v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest = (function() { + + /** + * Properties of a RetrieveForApplicationTermsOfServiceAgreementStateRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @interface IRetrieveForApplicationTermsOfServiceAgreementStateRequest + * @property {string|null} [parent] RetrieveForApplicationTermsOfServiceAgreementStateRequest parent + */ + + /** + * Constructs a new RetrieveForApplicationTermsOfServiceAgreementStateRequest. + * @memberof google.shopping.merchant.accounts.v1beta + * @classdesc Represents a RetrieveForApplicationTermsOfServiceAgreementStateRequest. + * @implements IRetrieveForApplicationTermsOfServiceAgreementStateRequest + * @constructor + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest=} [properties] Properties to set + */ + function RetrieveForApplicationTermsOfServiceAgreementStateRequest(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]]; + } + + /** + * RetrieveForApplicationTermsOfServiceAgreementStateRequest parent. + * @member {string} parent + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @instance + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.prototype.parent = ""; + + /** + * Creates a new RetrieveForApplicationTermsOfServiceAgreementStateRequest instance using the specified properties. + * @function create + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest=} [properties] Properties to set + * @returns {google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest} RetrieveForApplicationTermsOfServiceAgreementStateRequest instance + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.create = function create(properties) { + return new RetrieveForApplicationTermsOfServiceAgreementStateRequest(properties); + }; + + /** + * Encodes the specified RetrieveForApplicationTermsOfServiceAgreementStateRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify|verify} messages. + * @function encode + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest} message RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified RetrieveForApplicationTermsOfServiceAgreementStateRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest} message RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @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.RetrieveForApplicationTermsOfServiceAgreementStateRequest} RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.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.RetrieveForApplicationTermsOfServiceAgreementStateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest} RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrieveForApplicationTermsOfServiceAgreementStateRequest message. + * @function verify + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest} RetrieveForApplicationTermsOfServiceAgreementStateRequest + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest) + return object; + var message = new $root.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a RetrieveForApplicationTermsOfServiceAgreementStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @static + * @param {google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest} message RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this RetrieveForApplicationTermsOfServiceAgreementStateRequest to JSON. + * @function toJSON + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @instance + * @returns {Object.} JSON object + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @function getTypeUrl + * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveForApplicationTermsOfServiceAgreementStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest"; + }; + + return RetrieveForApplicationTermsOfServiceAgreementStateRequest; + })(); + + return v1beta; + })(); + + return accounts; + })(); + + return merchant; + })(); + + shopping.type = (function() { + + /** + * Namespace type. + * @memberof google.shopping + * @namespace + */ + var type = {}; + + type.Weight = (function() { + + /** + * Properties of a Weight. + * @memberof google.shopping.type + * @interface IWeight + * @property {number|Long|null} [amountMicros] Weight amountMicros + * @property {google.shopping.type.Weight.WeightUnit|null} [unit] Weight unit + */ + + /** + * Constructs a new Weight. + * @memberof google.shopping.type + * @classdesc Represents a Weight. + * @implements IWeight + * @constructor + * @param {google.shopping.type.IWeight=} [properties] Properties to set + */ + function Weight(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]]; + } + + /** + * Weight amountMicros. + * @member {number|Long|null|undefined} amountMicros + * @memberof google.shopping.type.Weight + * @instance + */ + Weight.prototype.amountMicros = null; + + /** + * Weight unit. + * @member {google.shopping.type.Weight.WeightUnit} unit + * @memberof google.shopping.type.Weight + * @instance + */ + Weight.prototype.unit = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Weight _amountMicros. + * @member {"amountMicros"|undefined} _amountMicros + * @memberof google.shopping.type.Weight + * @instance + */ + Object.defineProperty(Weight.prototype, "_amountMicros", { + get: $util.oneOfGetter($oneOfFields = ["amountMicros"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Weight instance using the specified properties. + * @function create + * @memberof google.shopping.type.Weight + * @static + * @param {google.shopping.type.IWeight=} [properties] Properties to set + * @returns {google.shopping.type.Weight} Weight instance + */ + Weight.create = function create(properties) { + return new Weight(properties); + }; + + /** + * Encodes the specified Weight message. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages. + * @function encode + * @memberof google.shopping.type.Weight + * @static + * @param {google.shopping.type.IWeight} message Weight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Weight.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amountMicros != null && Object.hasOwnProperty.call(message, "amountMicros")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amountMicros); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unit); + return writer; + }; + + /** + * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.type.Weight + * @static + * @param {google.shopping.type.IWeight} message Weight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Weight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Weight message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.type.Weight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.type.Weight} Weight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Weight.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.type.Weight(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.amountMicros = reader.int64(); + break; + } + case 2: { + message.unit = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Weight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.type.Weight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.type.Weight} Weight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Weight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Weight message. + * @function verify + * @memberof google.shopping.type.Weight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Weight.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) { + properties._amountMicros = 1; + if (!$util.isInteger(message.amountMicros) && !(message.amountMicros && $util.isInteger(message.amountMicros.low) && $util.isInteger(message.amountMicros.high))) + return "amountMicros: integer|Long expected"; + } + if (message.unit != null && message.hasOwnProperty("unit")) + switch (message.unit) { + default: + return "unit: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Weight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.type.Weight + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.type.Weight} Weight + */ + Weight.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.type.Weight) + return object; + var message = new $root.google.shopping.type.Weight(); + if (object.amountMicros != null) + if ($util.Long) + (message.amountMicros = $util.Long.fromValue(object.amountMicros)).unsigned = false; + else if (typeof object.amountMicros === "string") + message.amountMicros = parseInt(object.amountMicros, 10); + else if (typeof object.amountMicros === "number") + message.amountMicros = object.amountMicros; + else if (typeof object.amountMicros === "object") + message.amountMicros = new $util.LongBits(object.amountMicros.low >>> 0, object.amountMicros.high >>> 0).toNumber(); + switch (object.unit) { + default: + if (typeof object.unit === "number") { + message.unit = object.unit; + break; + } + break; + case "WEIGHT_UNIT_UNSPECIFIED": + case 0: + message.unit = 0; + break; + case "POUND": + case 1: + message.unit = 1; + break; + case "KILOGRAM": + case 2: + message.unit = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Weight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.type.Weight + * @static + * @param {google.shopping.type.Weight} message Weight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Weight.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.unit = options.enums === String ? "WEIGHT_UNIT_UNSPECIFIED" : 0; + if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) { + if (typeof message.amountMicros === "number") + object.amountMicros = options.longs === String ? String(message.amountMicros) : message.amountMicros; + else + object.amountMicros = options.longs === String ? $util.Long.prototype.toString.call(message.amountMicros) : options.longs === Number ? new $util.LongBits(message.amountMicros.low >>> 0, message.amountMicros.high >>> 0).toNumber() : message.amountMicros; + if (options.oneofs) + object._amountMicros = "amountMicros"; + } + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = options.enums === String ? $root.google.shopping.type.Weight.WeightUnit[message.unit] === undefined ? message.unit : $root.google.shopping.type.Weight.WeightUnit[message.unit] : message.unit; + return object; + }; + + /** + * Converts this Weight to JSON. + * @function toJSON + * @memberof google.shopping.type.Weight + * @instance + * @returns {Object.} JSON object + */ + Weight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Weight + * @function getTypeUrl + * @memberof google.shopping.type.Weight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Weight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.type.Weight"; + }; + + /** + * WeightUnit enum. + * @name google.shopping.type.Weight.WeightUnit + * @enum {number} + * @property {number} WEIGHT_UNIT_UNSPECIFIED=0 WEIGHT_UNIT_UNSPECIFIED value + * @property {number} POUND=1 POUND value + * @property {number} KILOGRAM=2 KILOGRAM value + */ + Weight.WeightUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEIGHT_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "POUND"] = 1; + values[valuesById[2] = "KILOGRAM"] = 2; + return values; + })(); + + return Weight; + })(); + + type.Price = (function() { + + /** + * Properties of a Price. + * @memberof google.shopping.type + * @interface IPrice + * @property {number|Long|null} [amountMicros] Price amountMicros + * @property {string|null} [currencyCode] Price currencyCode + */ + + /** + * Constructs a new Price. + * @memberof google.shopping.type + * @classdesc Represents a Price. + * @implements IPrice + * @constructor + * @param {google.shopping.type.IPrice=} [properties] Properties to set + */ + function Price(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]]; + } + + /** + * Price amountMicros. + * @member {number|Long|null|undefined} amountMicros + * @memberof google.shopping.type.Price + * @instance + */ + Price.prototype.amountMicros = null; + + /** + * Price currencyCode. + * @member {string|null|undefined} currencyCode + * @memberof google.shopping.type.Price + * @instance + */ + Price.prototype.currencyCode = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Price _amountMicros. + * @member {"amountMicros"|undefined} _amountMicros + * @memberof google.shopping.type.Price + * @instance + */ + Object.defineProperty(Price.prototype, "_amountMicros", { + get: $util.oneOfGetter($oneOfFields = ["amountMicros"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Price _currencyCode. + * @member {"currencyCode"|undefined} _currencyCode + * @memberof google.shopping.type.Price + * @instance + */ + Object.defineProperty(Price.prototype, "_currencyCode", { + get: $util.oneOfGetter($oneOfFields = ["currencyCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Price instance using the specified properties. + * @function create + * @memberof google.shopping.type.Price + * @static + * @param {google.shopping.type.IPrice=} [properties] Properties to set + * @returns {google.shopping.type.Price} Price instance + */ + Price.create = function create(properties) { + return new Price(properties); + }; + + /** + * Encodes the specified Price message. Does not implicitly {@link google.shopping.type.Price.verify|verify} messages. + * @function encode + * @memberof google.shopping.type.Price + * @static + * @param {google.shopping.type.IPrice} message Price message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Price.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amountMicros != null && Object.hasOwnProperty.call(message, "amountMicros")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amountMicros); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.currencyCode); + return writer; + }; + + /** + * Encodes the specified Price message, length delimited. Does not implicitly {@link google.shopping.type.Price.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.type.Price + * @static + * @param {google.shopping.type.IPrice} message Price message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Price.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Price message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.type.Price + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.type.Price} Price + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Price.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.type.Price(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.amountMicros = reader.int64(); + break; + } + case 2: { + message.currencyCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Price message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.type.Price + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.type.Price} Price + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Price.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Price message. + * @function verify + * @memberof google.shopping.type.Price + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Price.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) { + properties._amountMicros = 1; + if (!$util.isInteger(message.amountMicros) && !(message.amountMicros && $util.isInteger(message.amountMicros.low) && $util.isInteger(message.amountMicros.high))) + return "amountMicros: integer|Long expected"; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { + properties._currencyCode = 1; + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + } + return null; + }; + + /** + * Creates a Price message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.type.Price + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.type.Price} Price + */ + Price.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.type.Price) + return object; + var message = new $root.google.shopping.type.Price(); + if (object.amountMicros != null) + if ($util.Long) + (message.amountMicros = $util.Long.fromValue(object.amountMicros)).unsigned = false; + else if (typeof object.amountMicros === "string") + message.amountMicros = parseInt(object.amountMicros, 10); + else if (typeof object.amountMicros === "number") + message.amountMicros = object.amountMicros; + else if (typeof object.amountMicros === "object") + message.amountMicros = new $util.LongBits(object.amountMicros.low >>> 0, object.amountMicros.high >>> 0).toNumber(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + return message; + }; + + /** + * Creates a plain object from a Price message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.type.Price + * @static + * @param {google.shopping.type.Price} message Price + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Price.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) { + if (typeof message.amountMicros === "number") + object.amountMicros = options.longs === String ? String(message.amountMicros) : message.amountMicros; + else + object.amountMicros = options.longs === String ? $util.Long.prototype.toString.call(message.amountMicros) : options.longs === Number ? new $util.LongBits(message.amountMicros.low >>> 0, message.amountMicros.high >>> 0).toNumber() : message.amountMicros; + if (options.oneofs) + object._amountMicros = "amountMicros"; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { + object.currencyCode = message.currencyCode; + if (options.oneofs) + object._currencyCode = "currencyCode"; + } + return object; + }; + + /** + * Converts this Price to JSON. + * @function toJSON + * @memberof google.shopping.type.Price + * @instance + * @returns {Object.} JSON object + */ + Price.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Price + * @function getTypeUrl + * @memberof google.shopping.type.Price + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Price.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.type.Price"; + }; + + return Price; + })(); + + type.CustomAttribute = (function() { + + /** + * Properties of a CustomAttribute. + * @memberof google.shopping.type + * @interface ICustomAttribute + * @property {string|null} [name] CustomAttribute name + * @property {string|null} [value] CustomAttribute value + * @property {Array.|null} [groupValues] CustomAttribute groupValues + */ + + /** + * Constructs a new CustomAttribute. + * @memberof google.shopping.type + * @classdesc Represents a CustomAttribute. + * @implements ICustomAttribute + * @constructor + * @param {google.shopping.type.ICustomAttribute=} [properties] Properties to set + */ + function CustomAttribute(properties) { + this.groupValues = []; + 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]]; + } + + /** + * CustomAttribute name. + * @member {string|null|undefined} name + * @memberof google.shopping.type.CustomAttribute + * @instance + */ + CustomAttribute.prototype.name = null; + + /** + * CustomAttribute value. + * @member {string|null|undefined} value + * @memberof google.shopping.type.CustomAttribute + * @instance + */ + CustomAttribute.prototype.value = null; + + /** + * CustomAttribute groupValues. + * @member {Array.} groupValues + * @memberof google.shopping.type.CustomAttribute + * @instance + */ + CustomAttribute.prototype.groupValues = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomAttribute _name. + * @member {"name"|undefined} _name + * @memberof google.shopping.type.CustomAttribute + * @instance + */ + Object.defineProperty(CustomAttribute.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomAttribute _value. + * @member {"value"|undefined} _value + * @memberof google.shopping.type.CustomAttribute + * @instance + */ + Object.defineProperty(CustomAttribute.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomAttribute instance using the specified properties. + * @function create + * @memberof google.shopping.type.CustomAttribute + * @static + * @param {google.shopping.type.ICustomAttribute=} [properties] Properties to set + * @returns {google.shopping.type.CustomAttribute} CustomAttribute instance + */ + CustomAttribute.create = function create(properties) { + return new CustomAttribute(properties); + }; + + /** + * Encodes the specified CustomAttribute message. Does not implicitly {@link google.shopping.type.CustomAttribute.verify|verify} messages. + * @function encode + * @memberof google.shopping.type.CustomAttribute + * @static + * @param {google.shopping.type.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAttribute.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.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.groupValues != null && message.groupValues.length) + for (var i = 0; i < message.groupValues.length; ++i) + $root.google.shopping.type.CustomAttribute.encode(message.groupValues[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.shopping.type.CustomAttribute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.type.CustomAttribute + * @static + * @param {google.shopping.type.ICustomAttribute} message CustomAttribute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomAttribute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.type.CustomAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.type.CustomAttribute} CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAttribute.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.type.CustomAttribute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + case 3: { + if (!(message.groupValues && message.groupValues.length)) + message.groupValues = []; + message.groupValues.push($root.google.shopping.type.CustomAttribute.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.type.CustomAttribute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.type.CustomAttribute} CustomAttribute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomAttribute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomAttribute message. + * @function verify + * @memberof google.shopping.type.CustomAttribute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomAttribute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + if (message.groupValues != null && message.hasOwnProperty("groupValues")) { + if (!Array.isArray(message.groupValues)) + return "groupValues: array expected"; + for (var i = 0; i < message.groupValues.length; ++i) { + var error = $root.google.shopping.type.CustomAttribute.verify(message.groupValues[i]); + if (error) + return "groupValues." + error; + } + } + return null; + }; + + /** + * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.type.CustomAttribute + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.type.CustomAttribute} CustomAttribute + */ + CustomAttribute.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.type.CustomAttribute) + return object; + var message = new $root.google.shopping.type.CustomAttribute(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + if (object.groupValues) { + if (!Array.isArray(object.groupValues)) + throw TypeError(".google.shopping.type.CustomAttribute.groupValues: array expected"); + message.groupValues = []; + for (var i = 0; i < object.groupValues.length; ++i) { + if (typeof object.groupValues[i] !== "object") + throw TypeError(".google.shopping.type.CustomAttribute.groupValues: object expected"); + message.groupValues[i] = $root.google.shopping.type.CustomAttribute.fromObject(object.groupValues[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.type.CustomAttribute + * @static + * @param {google.shopping.type.CustomAttribute} message CustomAttribute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomAttribute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupValues = []; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + if (message.groupValues && message.groupValues.length) { + object.groupValues = []; + for (var j = 0; j < message.groupValues.length; ++j) + object.groupValues[j] = $root.google.shopping.type.CustomAttribute.toObject(message.groupValues[j], options); + } + return object; + }; + + /** + * Converts this CustomAttribute to JSON. + * @function toJSON + * @memberof google.shopping.type.CustomAttribute + * @instance + * @returns {Object.} JSON object + */ + CustomAttribute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomAttribute + * @function getTypeUrl + * @memberof google.shopping.type.CustomAttribute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.type.CustomAttribute"; + }; + + return CustomAttribute; + })(); + + type.Destination = (function() { + + /** + * Properties of a Destination. + * @memberof google.shopping.type + * @interface IDestination + */ + + /** + * Constructs a new Destination. + * @memberof google.shopping.type + * @classdesc Represents a Destination. + * @implements IDestination + * @constructor + * @param {google.shopping.type.IDestination=} [properties] Properties to set + */ + function Destination(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 Destination instance using the specified properties. + * @function create + * @memberof google.shopping.type.Destination + * @static + * @param {google.shopping.type.IDestination=} [properties] Properties to set + * @returns {google.shopping.type.Destination} Destination instance + */ + Destination.create = function create(properties) { + return new Destination(properties); + }; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.shopping.type.Destination.verify|verify} messages. + * @function encode + * @memberof google.shopping.type.Destination + * @static + * @param {google.shopping.type.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.shopping.type.Destination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.type.Destination + * @static + * @param {google.shopping.type.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.type.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.type.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.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.type.Destination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.type.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.type.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Destination message. + * @function verify + * @memberof google.shopping.type.Destination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Destination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Destination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.type.Destination + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.type.Destination} Destination + */ + Destination.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.type.Destination) + return object; + return new $root.google.shopping.type.Destination(); + }; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.type.Destination + * @static + * @param {google.shopping.type.Destination} message Destination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Destination.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Destination to JSON. + * @function toJSON + * @memberof google.shopping.type.Destination + * @instance + * @returns {Object.} JSON object + */ + Destination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Destination + * @function getTypeUrl + * @memberof google.shopping.type.Destination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Destination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.type.Destination"; + }; + + /** + * DestinationEnum enum. + * @name google.shopping.type.Destination.DestinationEnum + * @enum {number} + * @property {number} DESTINATION_ENUM_UNSPECIFIED=0 DESTINATION_ENUM_UNSPECIFIED value + * @property {number} SHOPPING_ADS=1 SHOPPING_ADS value + * @property {number} DISPLAY_ADS=2 DISPLAY_ADS value + * @property {number} LOCAL_INVENTORY_ADS=3 LOCAL_INVENTORY_ADS value + * @property {number} FREE_LISTINGS=4 FREE_LISTINGS value + * @property {number} FREE_LOCAL_LISTINGS=5 FREE_LOCAL_LISTINGS value + * @property {number} YOUTUBE_SHOPPING=6 YOUTUBE_SHOPPING value + */ + Destination.DestinationEnum = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DESTINATION_ENUM_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHOPPING_ADS"] = 1; + values[valuesById[2] = "DISPLAY_ADS"] = 2; + values[valuesById[3] = "LOCAL_INVENTORY_ADS"] = 3; + values[valuesById[4] = "FREE_LISTINGS"] = 4; + values[valuesById[5] = "FREE_LOCAL_LISTINGS"] = 5; + values[valuesById[6] = "YOUTUBE_SHOPPING"] = 6; + return values; + })(); + + return Destination; + })(); + + type.ReportingContext = (function() { + + /** + * Properties of a ReportingContext. + * @memberof google.shopping.type + * @interface IReportingContext + */ + + /** + * Constructs a new ReportingContext. + * @memberof google.shopping.type + * @classdesc Represents a ReportingContext. + * @implements IReportingContext + * @constructor + * @param {google.shopping.type.IReportingContext=} [properties] Properties to set + */ + function ReportingContext(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 ReportingContext instance using the specified properties. + * @function create + * @memberof google.shopping.type.ReportingContext + * @static + * @param {google.shopping.type.IReportingContext=} [properties] Properties to set + * @returns {google.shopping.type.ReportingContext} ReportingContext instance + */ + ReportingContext.create = function create(properties) { + return new ReportingContext(properties); + }; + + /** + * Encodes the specified ReportingContext message. Does not implicitly {@link google.shopping.type.ReportingContext.verify|verify} messages. + * @function encode + * @memberof google.shopping.type.ReportingContext + * @static + * @param {google.shopping.type.IReportingContext} message ReportingContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportingContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ReportingContext message, length delimited. Does not implicitly {@link google.shopping.type.ReportingContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.type.ReportingContext + * @static + * @param {google.shopping.type.IReportingContext} message ReportingContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportingContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportingContext message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.type.ReportingContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.type.ReportingContext} ReportingContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportingContext.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.type.ReportingContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportingContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.type.ReportingContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.type.ReportingContext} ReportingContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportingContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportingContext message. + * @function verify + * @memberof google.shopping.type.ReportingContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportingContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ReportingContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.type.ReportingContext + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.type.ReportingContext} ReportingContext + */ + ReportingContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.type.ReportingContext) + return object; + return new $root.google.shopping.type.ReportingContext(); + }; + + /** + * Creates a plain object from a ReportingContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.type.ReportingContext + * @static + * @param {google.shopping.type.ReportingContext} message ReportingContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportingContext.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ReportingContext to JSON. + * @function toJSON + * @memberof google.shopping.type.ReportingContext + * @instance + * @returns {Object.} JSON object + */ + ReportingContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReportingContext + * @function getTypeUrl + * @memberof google.shopping.type.ReportingContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReportingContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.type.ReportingContext"; + }; + + /** + * ReportingContextEnum enum. + * @name google.shopping.type.ReportingContext.ReportingContextEnum + * @enum {number} + * @property {number} REPORTING_CONTEXT_ENUM_UNSPECIFIED=0 REPORTING_CONTEXT_ENUM_UNSPECIFIED value + * @property {number} SHOPPING_ADS=1 SHOPPING_ADS value + * @property {number} DISCOVERY_ADS=2 DISCOVERY_ADS value + * @property {number} DEMAND_GEN_ADS=13 DEMAND_GEN_ADS value + * @property {number} DEMAND_GEN_ADS_DISCOVER_SURFACE=14 DEMAND_GEN_ADS_DISCOVER_SURFACE value + * @property {number} VIDEO_ADS=3 VIDEO_ADS value + * @property {number} DISPLAY_ADS=4 DISPLAY_ADS value + * @property {number} LOCAL_INVENTORY_ADS=5 LOCAL_INVENTORY_ADS value + * @property {number} VEHICLE_INVENTORY_ADS=6 VEHICLE_INVENTORY_ADS value + * @property {number} FREE_LISTINGS=7 FREE_LISTINGS value + * @property {number} FREE_LOCAL_LISTINGS=8 FREE_LOCAL_LISTINGS value + * @property {number} FREE_LOCAL_VEHICLE_LISTINGS=9 FREE_LOCAL_VEHICLE_LISTINGS value + * @property {number} YOUTUBE_SHOPPING=10 YOUTUBE_SHOPPING value + * @property {number} CLOUD_RETAIL=11 CLOUD_RETAIL value + * @property {number} LOCAL_CLOUD_RETAIL=12 LOCAL_CLOUD_RETAIL value + */ + ReportingContext.ReportingContextEnum = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPORTING_CONTEXT_ENUM_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHOPPING_ADS"] = 1; + values[valuesById[2] = "DISCOVERY_ADS"] = 2; + values[valuesById[13] = "DEMAND_GEN_ADS"] = 13; + values[valuesById[14] = "DEMAND_GEN_ADS_DISCOVER_SURFACE"] = 14; + values[valuesById[3] = "VIDEO_ADS"] = 3; + values[valuesById[4] = "DISPLAY_ADS"] = 4; + values[valuesById[5] = "LOCAL_INVENTORY_ADS"] = 5; + values[valuesById[6] = "VEHICLE_INVENTORY_ADS"] = 6; + values[valuesById[7] = "FREE_LISTINGS"] = 7; + values[valuesById[8] = "FREE_LOCAL_LISTINGS"] = 8; + values[valuesById[9] = "FREE_LOCAL_VEHICLE_LISTINGS"] = 9; + values[valuesById[10] = "YOUTUBE_SHOPPING"] = 10; + values[valuesById[11] = "CLOUD_RETAIL"] = 11; + values[valuesById[12] = "LOCAL_CLOUD_RETAIL"] = 12; + return values; + })(); + + return ReportingContext; + })(); + + type.Channel = (function() { + + /** + * Properties of a Channel. + * @memberof google.shopping.type + * @interface IChannel + */ + + /** + * Constructs a new Channel. + * @memberof google.shopping.type + * @classdesc Represents a Channel. + * @implements IChannel + * @constructor + * @param {google.shopping.type.IChannel=} [properties] Properties to set + */ + function Channel(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 Channel instance using the specified properties. + * @function create + * @memberof google.shopping.type.Channel + * @static + * @param {google.shopping.type.IChannel=} [properties] Properties to set + * @returns {google.shopping.type.Channel} Channel instance + */ + Channel.create = function create(properties) { + return new Channel(properties); + }; + + /** + * Encodes the specified Channel message. Does not implicitly {@link google.shopping.type.Channel.verify|verify} messages. + * @function encode + * @memberof google.shopping.type.Channel + * @static + * @param {google.shopping.type.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link google.shopping.type.Channel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.shopping.type.Channel + * @static + * @param {google.shopping.type.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @function decode + * @memberof google.shopping.type.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.shopping.type.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.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.type.Channel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.shopping.type.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.shopping.type.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Channel message. + * @function verify + * @memberof google.shopping.type.Channel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Channel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Channel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.shopping.type.Channel + * @static + * @param {Object.} object Plain object + * @returns {google.shopping.type.Channel} Channel + */ + Channel.fromObject = function fromObject(object) { + if (object instanceof $root.google.shopping.type.Channel) + return object; + return new $root.google.shopping.type.Channel(); + }; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.shopping.type.Channel + * @static + * @param {google.shopping.type.Channel} message Channel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Channel.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Channel to JSON. + * @function toJSON + * @memberof google.shopping.type.Channel + * @instance + * @returns {Object.} JSON object + */ + Channel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Channel + * @function getTypeUrl + * @memberof google.shopping.type.Channel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Channel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.shopping.type.Channel"; + }; + + /** + * ChannelEnum enum. + * @name google.shopping.type.Channel.ChannelEnum + * @enum {number} + * @property {number} CHANNEL_ENUM_UNSPECIFIED=0 CHANNEL_ENUM_UNSPECIFIED value + * @property {number} ONLINE=1 ONLINE value + * @property {number} LOCAL=2 LOCAL value + */ + Channel.ChannelEnum = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANNEL_ENUM_UNSPECIFIED"] = 0; + values[valuesById[1] = "ONLINE"] = 1; + values[valuesById[2] = "LOCAL"] = 2; + return values; + })(); + + return Channel; + })(); + + return type; + })(); + + return shopping; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.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.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + 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]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.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.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(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]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.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.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + 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]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.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.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(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]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.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.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + 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]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.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.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + 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]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.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.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(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]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.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.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.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.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.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.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.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.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + 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]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.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.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.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.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(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]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.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.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + 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]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.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.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.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.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.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.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.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["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.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.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.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.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.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.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.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.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.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.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(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]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.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.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.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.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.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.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.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.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.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.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.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.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.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.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.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.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.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.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.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.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.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.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.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.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.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.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.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.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.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.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.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.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.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.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.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.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.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.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.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.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.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.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.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.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.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.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.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.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.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.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.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.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.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.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.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.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.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.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.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.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.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.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.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.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + 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]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.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.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.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.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + 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]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.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.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.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.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.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.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.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.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.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.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(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]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.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.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(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]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.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.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(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]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.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.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(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]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.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.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(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]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.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.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(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]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.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.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(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]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.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.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(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]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.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.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(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]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.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.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Interval = (function() { + + /** + * Properties of an Interval. + * @memberof google.type + * @interface IInterval + * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime + */ + + /** + * Constructs a new Interval. + * @memberof google.type + * @classdesc Represents an Interval. + * @implements IInterval + * @constructor + * @param {google.type.IInterval=} [properties] Properties to set + */ + function Interval(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]]; + } + + /** + * Interval startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.startTime = null; + + /** + * Interval endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.endTime = null; + + /** + * Creates a new Interval instance using the specified properties. + * @function create + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval=} [properties] Properties to set + * @returns {google.type.Interval} Interval instance + */ + Interval.create = function create(properties) { + return new Interval(properties); + }; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encode + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @function decode + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.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.type.Interval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interval message. + * @function verify + * @memberof google.type.Interval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Interval + * @static + * @param {Object.} object Plain object + * @returns {google.type.Interval} Interval + */ + Interval.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Interval) + return object; + var message = new $root.google.type.Interval(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.type.Interval.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.type.Interval.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Interval + * @static + * @param {google.type.Interval} message Interval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Interval to JSON. + * @function toJSON + * @memberof google.type.Interval + * @instance + * @returns {Object.} JSON object + */ + Interval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interval + * @function getTypeUrl + * @memberof google.type.Interval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Interval"; + }; + + return Interval; + })(); + + type.DateTime = (function() { + + /** + * Properties of a DateTime. + * @memberof google.type + * @interface IDateTime + * @property {number|null} [year] DateTime year + * @property {number|null} [month] DateTime month + * @property {number|null} [day] DateTime day + * @property {number|null} [hours] DateTime hours + * @property {number|null} [minutes] DateTime minutes + * @property {number|null} [seconds] DateTime seconds + * @property {number|null} [nanos] DateTime nanos + * @property {google.protobuf.IDuration|null} [utcOffset] DateTime utcOffset + * @property {google.type.ITimeZone|null} [timeZone] DateTime timeZone + */ + + /** + * Constructs a new DateTime. + * @memberof google.type + * @classdesc Represents a DateTime. + * @implements IDateTime + * @constructor + * @param {google.type.IDateTime=} [properties] Properties to set + */ + function DateTime(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]]; + } + + /** + * DateTime year. + * @member {number} year + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.year = 0; + + /** + * DateTime month. + * @member {number} month + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.month = 0; + + /** + * DateTime day. + * @member {number} day + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.day = 0; + + /** + * DateTime hours. + * @member {number} hours + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.hours = 0; + + /** + * DateTime minutes. + * @member {number} minutes + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.minutes = 0; + + /** + * DateTime seconds. + * @member {number} seconds + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.seconds = 0; + + /** + * DateTime nanos. + * @member {number} nanos + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.nanos = 0; + + /** + * DateTime utcOffset. + * @member {google.protobuf.IDuration|null|undefined} utcOffset + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.utcOffset = null; + + /** + * DateTime timeZone. + * @member {google.type.ITimeZone|null|undefined} timeZone + * @memberof google.type.DateTime + * @instance + */ + DateTime.prototype.timeZone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DateTime timeOffset. + * @member {"utcOffset"|"timeZone"|undefined} timeOffset + * @memberof google.type.DateTime + * @instance + */ + Object.defineProperty(DateTime.prototype, "timeOffset", { + get: $util.oneOfGetter($oneOfFields = ["utcOffset", "timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DateTime instance using the specified properties. + * @function create + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime=} [properties] Properties to set + * @returns {google.type.DateTime} DateTime instance + */ + DateTime.create = function create(properties) { + return new DateTime(properties); + }; + + /** + * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @function encode + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime} message DateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.nanos); + if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) + $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.DateTime + * @static + * @param {google.type.IDateTime} message DateTime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DateTime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DateTime message from the specified reader or buffer. + * @function decode + * @memberof google.type.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.DateTime} DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTime.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.type.DateTime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + case 4: { + message.hours = reader.int32(); + break; + } + case 5: { + message.minutes = reader.int32(); + break; + } + case 6: { + message.seconds = reader.int32(); + break; + } + case 7: { + message.nanos = reader.int32(); + break; + } + case 8: { + message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DateTime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.DateTime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.DateTime} DateTime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DateTime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DateTime message. + * @function verify + * @memberof google.type.DateTime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DateTime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + properties.timeOffset = 1; + { + var error = $root.google.protobuf.Duration.verify(message.utcOffset); + if (error) + return "utcOffset." + error; + } + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + if (properties.timeOffset === 1) + return "timeOffset: multiple values"; + properties.timeOffset = 1; + { + var error = $root.google.type.TimeZone.verify(message.timeZone); + if (error) + return "timeZone." + error; + } + } + return null; + }; + + /** + * Creates a DateTime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.DateTime + * @static + * @param {Object.} object Plain object + * @returns {google.type.DateTime} DateTime + */ + DateTime.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.DateTime) + return object; + var message = new $root.google.type.DateTime(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + if (object.utcOffset != null) { + if (typeof object.utcOffset !== "object") + throw TypeError(".google.type.DateTime.utcOffset: object expected"); + message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); + } + if (object.timeZone != null) { + if (typeof object.timeZone !== "object") + throw TypeError(".google.type.DateTime.timeZone: object expected"); + message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); + } + return message; + }; + + /** + * Creates a plain object from a DateTime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.DateTime + * @static + * @param {google.type.DateTime} message DateTime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DateTime.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { + object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); + if (options.oneofs) + object.timeOffset = "utcOffset"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); + if (options.oneofs) + object.timeOffset = "timeZone"; + } + return object; + }; + + /** + * Converts this DateTime to JSON. + * @function toJSON + * @memberof google.type.DateTime + * @instance + * @returns {Object.} JSON object + */ + DateTime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DateTime + * @function getTypeUrl + * @memberof google.type.DateTime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DateTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.DateTime"; + }; + + return DateTime; + })(); + + type.TimeZone = (function() { + + /** + * Properties of a TimeZone. + * @memberof google.type + * @interface ITimeZone + * @property {string|null} [id] TimeZone id + * @property {string|null} [version] TimeZone version + */ + + /** + * Constructs a new TimeZone. + * @memberof google.type + * @classdesc Represents a TimeZone. + * @implements ITimeZone + * @constructor + * @param {google.type.ITimeZone=} [properties] Properties to set + */ + function TimeZone(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]]; + } + + /** + * TimeZone id. + * @member {string} id + * @memberof google.type.TimeZone + * @instance + */ + TimeZone.prototype.id = ""; + + /** + * TimeZone version. + * @member {string} version + * @memberof google.type.TimeZone + * @instance + */ + TimeZone.prototype.version = ""; + + /** + * Creates a new TimeZone instance using the specified properties. + * @function create + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone=} [properties] Properties to set + * @returns {google.type.TimeZone} TimeZone instance + */ + TimeZone.create = function create(properties) { + return new TimeZone(properties); + }; + + /** + * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @function encode + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone} message TimeZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZone.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + return writer; + }; + + /** + * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeZone + * @static + * @param {google.type.ITimeZone} message TimeZone message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeZone.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeZone message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeZone} TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZone.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.type.TimeZone(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeZone message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeZone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeZone} TimeZone + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeZone.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeZone message. + * @function verify + * @memberof google.type.TimeZone + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeZone.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeZone + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeZone} TimeZone + */ + TimeZone.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeZone) + return object; + var message = new $root.google.type.TimeZone(); + if (object.id != null) + message.id = String(object.id); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a TimeZone message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeZone + * @static + * @param {google.type.TimeZone} message TimeZone + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeZone.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.version = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this TimeZone to JSON. + * @function toJSON + * @memberof google.type.TimeZone + * @instance + * @returns {Object.} JSON object + */ + TimeZone.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeZone + * @function getTypeUrl + * @memberof google.type.TimeZone + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeZone"; + }; + + return TimeZone; + })(); + + type.PhoneNumber = (function() { + + /** + * Properties of a PhoneNumber. + * @memberof google.type + * @interface IPhoneNumber + * @property {string|null} [e164Number] PhoneNumber e164Number + * @property {google.type.PhoneNumber.IShortCode|null} [shortCode] PhoneNumber shortCode + * @property {string|null} [extension] PhoneNumber extension + */ + + /** + * Constructs a new PhoneNumber. + * @memberof google.type + * @classdesc Represents a PhoneNumber. + * @implements IPhoneNumber + * @constructor + * @param {google.type.IPhoneNumber=} [properties] Properties to set + */ + function PhoneNumber(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]]; + } + + /** + * PhoneNumber e164Number. + * @member {string|null|undefined} e164Number + * @memberof google.type.PhoneNumber + * @instance + */ + PhoneNumber.prototype.e164Number = null; + + /** + * PhoneNumber shortCode. + * @member {google.type.PhoneNumber.IShortCode|null|undefined} shortCode + * @memberof google.type.PhoneNumber + * @instance + */ + PhoneNumber.prototype.shortCode = null; + + /** + * PhoneNumber extension. + * @member {string} extension + * @memberof google.type.PhoneNumber + * @instance + */ + PhoneNumber.prototype.extension = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PhoneNumber kind. + * @member {"e164Number"|"shortCode"|undefined} kind + * @memberof google.type.PhoneNumber + * @instance + */ + Object.defineProperty(PhoneNumber.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["e164Number", "shortCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PhoneNumber instance using the specified properties. + * @function create + * @memberof google.type.PhoneNumber + * @static + * @param {google.type.IPhoneNumber=} [properties] Properties to set + * @returns {google.type.PhoneNumber} PhoneNumber instance + */ + PhoneNumber.create = function create(properties) { + return new PhoneNumber(properties); + }; + + /** + * Encodes the specified PhoneNumber message. Does not implicitly {@link google.type.PhoneNumber.verify|verify} messages. + * @function encode + * @memberof google.type.PhoneNumber + * @static + * @param {google.type.IPhoneNumber} message PhoneNumber message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhoneNumber.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.e164Number != null && Object.hasOwnProperty.call(message, "e164Number")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.e164Number); + if (message.shortCode != null && Object.hasOwnProperty.call(message, "shortCode")) + $root.google.type.PhoneNumber.ShortCode.encode(message.shortCode, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.extension); + return writer; + }; + + /** + * Encodes the specified PhoneNumber message, length delimited. Does not implicitly {@link google.type.PhoneNumber.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.PhoneNumber + * @static + * @param {google.type.IPhoneNumber} message PhoneNumber message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhoneNumber.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhoneNumber message from the specified reader or buffer. + * @function decode + * @memberof google.type.PhoneNumber + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.PhoneNumber} PhoneNumber + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhoneNumber.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.type.PhoneNumber(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.e164Number = reader.string(); + break; + } + case 2: { + message.shortCode = $root.google.type.PhoneNumber.ShortCode.decode(reader, reader.uint32()); + break; + } + case 3: { + message.extension = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhoneNumber message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.PhoneNumber + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.PhoneNumber} PhoneNumber + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhoneNumber.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhoneNumber message. + * @function verify + * @memberof google.type.PhoneNumber + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhoneNumber.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.e164Number != null && message.hasOwnProperty("e164Number")) { + properties.kind = 1; + if (!$util.isString(message.e164Number)) + return "e164Number: string expected"; + } + if (message.shortCode != null && message.hasOwnProperty("shortCode")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.type.PhoneNumber.ShortCode.verify(message.shortCode); + if (error) + return "shortCode." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) + if (!$util.isString(message.extension)) + return "extension: string expected"; + return null; + }; + + /** + * Creates a PhoneNumber message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.PhoneNumber + * @static + * @param {Object.} object Plain object + * @returns {google.type.PhoneNumber} PhoneNumber + */ + PhoneNumber.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.PhoneNumber) + return object; + var message = new $root.google.type.PhoneNumber(); + if (object.e164Number != null) + message.e164Number = String(object.e164Number); + if (object.shortCode != null) { + if (typeof object.shortCode !== "object") + throw TypeError(".google.type.PhoneNumber.shortCode: object expected"); + message.shortCode = $root.google.type.PhoneNumber.ShortCode.fromObject(object.shortCode); + } + if (object.extension != null) + message.extension = String(object.extension); + return message; + }; + + /** + * Creates a plain object from a PhoneNumber message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.PhoneNumber + * @static + * @param {google.type.PhoneNumber} message PhoneNumber + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhoneNumber.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.extension = ""; + if (message.e164Number != null && message.hasOwnProperty("e164Number")) { + object.e164Number = message.e164Number; + if (options.oneofs) + object.kind = "e164Number"; + } + if (message.shortCode != null && message.hasOwnProperty("shortCode")) { + object.shortCode = $root.google.type.PhoneNumber.ShortCode.toObject(message.shortCode, options); + if (options.oneofs) + object.kind = "shortCode"; + } + if (message.extension != null && message.hasOwnProperty("extension")) + object.extension = message.extension; + return object; + }; + + /** + * Converts this PhoneNumber to JSON. + * @function toJSON + * @memberof google.type.PhoneNumber + * @instance + * @returns {Object.} JSON object + */ + PhoneNumber.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhoneNumber + * @function getTypeUrl + * @memberof google.type.PhoneNumber + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhoneNumber.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.PhoneNumber"; + }; + + PhoneNumber.ShortCode = (function() { + + /** + * Properties of a ShortCode. + * @memberof google.type.PhoneNumber + * @interface IShortCode + * @property {string|null} [regionCode] ShortCode regionCode + * @property {string|null} [number] ShortCode number + */ + + /** + * Constructs a new ShortCode. + * @memberof google.type.PhoneNumber + * @classdesc Represents a ShortCode. + * @implements IShortCode + * @constructor + * @param {google.type.PhoneNumber.IShortCode=} [properties] Properties to set + */ + function ShortCode(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]]; + } + + /** + * ShortCode regionCode. + * @member {string} regionCode + * @memberof google.type.PhoneNumber.ShortCode + * @instance + */ + ShortCode.prototype.regionCode = ""; + + /** + * ShortCode number. + * @member {string} number + * @memberof google.type.PhoneNumber.ShortCode + * @instance + */ + ShortCode.prototype.number = ""; + + /** + * Creates a new ShortCode instance using the specified properties. + * @function create + * @memberof google.type.PhoneNumber.ShortCode + * @static + * @param {google.type.PhoneNumber.IShortCode=} [properties] Properties to set + * @returns {google.type.PhoneNumber.ShortCode} ShortCode instance + */ + ShortCode.create = function create(properties) { + return new ShortCode(properties); + }; + + /** + * Encodes the specified ShortCode message. Does not implicitly {@link google.type.PhoneNumber.ShortCode.verify|verify} messages. + * @function encode + * @memberof google.type.PhoneNumber.ShortCode + * @static + * @param {google.type.PhoneNumber.IShortCode} message ShortCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShortCode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.number); + return writer; + }; + + /** + * Encodes the specified ShortCode message, length delimited. Does not implicitly {@link google.type.PhoneNumber.ShortCode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.PhoneNumber.ShortCode + * @static + * @param {google.type.PhoneNumber.IShortCode} message ShortCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShortCode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShortCode message from the specified reader or buffer. + * @function decode + * @memberof google.type.PhoneNumber.ShortCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.PhoneNumber.ShortCode} ShortCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShortCode.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.type.PhoneNumber.ShortCode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.regionCode = reader.string(); + break; + } + case 2: { + message.number = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShortCode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.PhoneNumber.ShortCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.PhoneNumber.ShortCode} ShortCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShortCode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShortCode message. + * @function verify + * @memberof google.type.PhoneNumber.ShortCode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShortCode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isString(message.number)) + return "number: string expected"; + return null; + }; + + /** + * Creates a ShortCode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.PhoneNumber.ShortCode + * @static + * @param {Object.} object Plain object + * @returns {google.type.PhoneNumber.ShortCode} ShortCode + */ + ShortCode.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.PhoneNumber.ShortCode) + return object; + var message = new $root.google.type.PhoneNumber.ShortCode(); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.number != null) + message.number = String(object.number); + return message; + }; + + /** + * Creates a plain object from a ShortCode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.PhoneNumber.ShortCode + * @static + * @param {google.type.PhoneNumber.ShortCode} message ShortCode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShortCode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionCode = ""; + object.number = ""; + } + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + return object; + }; + + /** + * Converts this ShortCode to JSON. + * @function toJSON + * @memberof google.type.PhoneNumber.ShortCode + * @instance + * @returns {Object.} JSON object + */ + ShortCode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShortCode + * @function getTypeUrl + * @memberof google.type.PhoneNumber.ShortCode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShortCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.PhoneNumber.ShortCode"; + }; + + return ShortCode; + })(); + + return PhoneNumber; + })(); + + type.PostalAddress = (function() { + + /** + * Properties of a PostalAddress. + * @memberof google.type + * @interface IPostalAddress + * @property {number|null} [revision] PostalAddress revision + * @property {string|null} [regionCode] PostalAddress regionCode + * @property {string|null} [languageCode] PostalAddress languageCode + * @property {string|null} [postalCode] PostalAddress postalCode + * @property {string|null} [sortingCode] PostalAddress sortingCode + * @property {string|null} [administrativeArea] PostalAddress administrativeArea + * @property {string|null} [locality] PostalAddress locality + * @property {string|null} [sublocality] PostalAddress sublocality + * @property {Array.|null} [addressLines] PostalAddress addressLines + * @property {Array.|null} [recipients] PostalAddress recipients + * @property {string|null} [organization] PostalAddress organization + */ + + /** + * Constructs a new PostalAddress. + * @memberof google.type + * @classdesc Represents a PostalAddress. + * @implements IPostalAddress + * @constructor + * @param {google.type.IPostalAddress=} [properties] Properties to set + */ + function PostalAddress(properties) { + this.addressLines = []; + this.recipients = []; + 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]]; + } + + /** + * PostalAddress revision. + * @member {number} revision + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.revision = 0; + + /** + * PostalAddress regionCode. + * @member {string} regionCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.regionCode = ""; + + /** + * PostalAddress languageCode. + * @member {string} languageCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.languageCode = ""; + + /** + * PostalAddress postalCode. + * @member {string} postalCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.postalCode = ""; + + /** + * PostalAddress sortingCode. + * @member {string} sortingCode + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.sortingCode = ""; + + /** + * PostalAddress administrativeArea. + * @member {string} administrativeArea + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.administrativeArea = ""; + + /** + * PostalAddress locality. + * @member {string} locality + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.locality = ""; + + /** + * PostalAddress sublocality. + * @member {string} sublocality + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.sublocality = ""; + + /** + * PostalAddress addressLines. + * @member {Array.} addressLines + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.addressLines = $util.emptyArray; + + /** + * PostalAddress recipients. + * @member {Array.} recipients + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.recipients = $util.emptyArray; + + /** + * PostalAddress organization. + * @member {string} organization + * @memberof google.type.PostalAddress + * @instance + */ + PostalAddress.prototype.organization = ""; + + /** + * Creates a new PostalAddress instance using the specified properties. + * @function create + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress=} [properties] Properties to set + * @returns {google.type.PostalAddress} PostalAddress instance + */ + PostalAddress.create = function create(properties) { + return new PostalAddress(properties); + }; + + /** + * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @function encode + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalAddress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCode); + if (message.sortingCode != null && Object.hasOwnProperty.call(message, "sortingCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sortingCode); + if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.administrativeArea); + if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.locality); + if (message.sublocality != null && Object.hasOwnProperty.call(message, "sublocality")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sublocality); + if (message.addressLines != null && message.addressLines.length) + for (var i = 0; i < message.addressLines.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.addressLines[i]); + if (message.recipients != null && message.recipients.length) + for (var i = 0; i < message.recipients.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.recipients[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.organization); + return writer; + }; + + /** + * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.PostalAddress + * @static + * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostalAddress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostalAddress message from the specified reader or buffer. + * @function decode + * @memberof google.type.PostalAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.PostalAddress} PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalAddress.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.type.PostalAddress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.revision = reader.int32(); + break; + } + case 2: { + message.regionCode = reader.string(); + break; + } + case 3: { + message.languageCode = reader.string(); + break; + } + case 4: { + message.postalCode = reader.string(); + break; + } + case 5: { + message.sortingCode = reader.string(); + break; + } + case 6: { + message.administrativeArea = reader.string(); + break; + } + case 7: { + message.locality = reader.string(); + break; + } + case 8: { + message.sublocality = reader.string(); + break; + } + case 9: { + if (!(message.addressLines && message.addressLines.length)) + message.addressLines = []; + message.addressLines.push(reader.string()); + break; + } + case 10: { + if (!(message.recipients && message.recipients.length)) + message.recipients = []; + message.recipients.push(reader.string()); + break; + } + case 11: { + message.organization = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostalAddress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.PostalAddress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.PostalAddress} PostalAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostalAddress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostalAddress message. + * @function verify + * @memberof google.type.PostalAddress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostalAddress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isInteger(message.revision)) + return "revision: integer expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + if (!$util.isString(message.postalCode)) + return "postalCode: string expected"; + if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) + if (!$util.isString(message.sortingCode)) + return "sortingCode: string expected"; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + if (!$util.isString(message.administrativeArea)) + return "administrativeArea: string expected"; + if (message.locality != null && message.hasOwnProperty("locality")) + if (!$util.isString(message.locality)) + return "locality: string expected"; + if (message.sublocality != null && message.hasOwnProperty("sublocality")) + if (!$util.isString(message.sublocality)) + return "sublocality: string expected"; + if (message.addressLines != null && message.hasOwnProperty("addressLines")) { + if (!Array.isArray(message.addressLines)) + return "addressLines: array expected"; + for (var i = 0; i < message.addressLines.length; ++i) + if (!$util.isString(message.addressLines[i])) + return "addressLines: string[] expected"; + } + if (message.recipients != null && message.hasOwnProperty("recipients")) { + if (!Array.isArray(message.recipients)) + return "recipients: array expected"; + for (var i = 0; i < message.recipients.length; ++i) + if (!$util.isString(message.recipients[i])) + return "recipients: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + return null; + }; + + /** + * Creates a PostalAddress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.PostalAddress + * @static + * @param {Object.} object Plain object + * @returns {google.type.PostalAddress} PostalAddress + */ + PostalAddress.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.PostalAddress) + return object; + var message = new $root.google.type.PostalAddress(); + if (object.revision != null) + message.revision = object.revision | 0; + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.postalCode != null) + message.postalCode = String(object.postalCode); + if (object.sortingCode != null) + message.sortingCode = String(object.sortingCode); + if (object.administrativeArea != null) + message.administrativeArea = String(object.administrativeArea); + if (object.locality != null) + message.locality = String(object.locality); + if (object.sublocality != null) + message.sublocality = String(object.sublocality); + if (object.addressLines) { + if (!Array.isArray(object.addressLines)) + throw TypeError(".google.type.PostalAddress.addressLines: array expected"); + message.addressLines = []; + for (var i = 0; i < object.addressLines.length; ++i) + message.addressLines[i] = String(object.addressLines[i]); + } + if (object.recipients) { + if (!Array.isArray(object.recipients)) + throw TypeError(".google.type.PostalAddress.recipients: array expected"); + message.recipients = []; + for (var i = 0; i < object.recipients.length; ++i) + message.recipients[i] = String(object.recipients[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + return message; + }; + + /** + * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.PostalAddress + * @static + * @param {google.type.PostalAddress} message PostalAddress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostalAddress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.addressLines = []; + object.recipients = []; + } + if (options.defaults) { + object.revision = 0; + object.regionCode = ""; + object.languageCode = ""; + object.postalCode = ""; + object.sortingCode = ""; + object.administrativeArea = ""; + object.locality = ""; + object.sublocality = ""; + object.organization = ""; + } + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.postalCode != null && message.hasOwnProperty("postalCode")) + object.postalCode = message.postalCode; + if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) + object.sortingCode = message.sortingCode; + if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) + object.administrativeArea = message.administrativeArea; + if (message.locality != null && message.hasOwnProperty("locality")) + object.locality = message.locality; + if (message.sublocality != null && message.hasOwnProperty("sublocality")) + object.sublocality = message.sublocality; + if (message.addressLines && message.addressLines.length) { + object.addressLines = []; + for (var j = 0; j < message.addressLines.length; ++j) + object.addressLines[j] = message.addressLines[j]; + } + if (message.recipients && message.recipients.length) { + object.recipients = []; + for (var j = 0; j < message.recipients.length; ++j) + object.recipients[j] = message.recipients[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + return object; + }; + + /** + * Converts this PostalAddress to JSON. + * @function toJSON + * @memberof google.type.PostalAddress + * @instance + * @returns {Object.} JSON object + */ + PostalAddress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostalAddress + * @function getTypeUrl + * @memberof google.type.PostalAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostalAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.PostalAddress"; + }; + + return PostalAddress; + })(); + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(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]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.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.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.json new file mode 100644 index 00000000000..d91feea2e61 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.json @@ -0,0 +1,6551 @@ +{ + "nested": { + "google": { + "nested": { + "shopping": { + "nested": { + "merchant": { + "nested": { + "accounts": { + "nested": { + "v1beta": { + "options": { + "go_package": "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb", + "java_multiple_files": true, + "java_outer_classname": "TermsOfServiceAgreementStateProto", + "java_package": "com.google.shopping.merchant.accounts.v1beta" + }, + "nested": { + "AccessRight": { + "values": { + "ACCESS_RIGHT_UNSPECIFIED": 0, + "STANDARD": 1, + "ADMIN": 2, + "PERFORMANCE_REPORTING": 3 + } + }, + "AccountTaxService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetAccountTax": { + "requestType": "GetAccountTaxRequest", + "responseType": "AccountTax", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/accounttax/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/accounttax/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAccountTax": { + "requestType": "ListAccountTaxRequest", + "responseType": "ListAccountTaxResponse", + "options": { + "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/accounttax", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{parent=accounts/*}/accounttax" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateAccountTax": { + "requestType": "UpdateAccountTaxRequest", + "responseType": "AccountTax", + "options": { + "(google.api.http).patch": "/accounts/v1beta/{account_tax.name=accounts/*/accounttax/*}", + "(google.api.http).body": "account_tax", + "(google.api.method_signature)": "account_tax" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/accounts/v1beta/{account_tax.name=accounts/*/accounttax/*}", + "body": "account_tax" + } + }, + { + "(google.api.method_signature)": "account_tax,update_mask" + }, + { + "(google.api.method_signature)": "account_tax" + } + ] + } + } + }, + "AccountTax": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/AccountTax", + "(google.api.resource).pattern": "accounts/{account}/accounttax/{tax}", + "(google.api.resource).plural": "accountTaxes", + "(google.api.resource).singular": "accountTax" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "account": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "taxRules": { + "rule": "repeated", + "type": "TaxRule", + "id": 3 + } + } + }, + "GetAccountTaxRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/AccountTax" + } + } + } + }, + "UpdateAccountTaxRequest": { + "fields": { + "accountTax": { + "type": "AccountTax", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListAccountTaxRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "merchantapi.googleapis.com/AccountTax" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAccountTaxResponse": { + "fields": { + "accountTaxes": { + "rule": "repeated", + "type": "AccountTax", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TaxRule": { + "oneofs": { + "location": { + "oneof": [ + "locationId", + "postCodeRange" + ] + }, + "rateCalculation": { + "oneof": [ + "useGoogleRate", + "selfSpecifiedRateMicros" + ] + } + }, + "fields": { + "locationId": { + "type": "int64", + "id": 2 + }, + "postCodeRange": { + "type": "TaxPostalCodeRange", + "id": 3 + }, + "useGoogleRate": { + "type": "bool", + "id": 4 + }, + "selfSpecifiedRateMicros": { + "type": "int64", + "id": 5 + }, + "regionCode": { + "type": "string", + "id": 1 + }, + "shippingTaxed": { + "type": "bool", + "id": 6 + }, + "effectiveTimePeriod": { + "type": "google.type.Interval", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "TaxPostalCodeRange": { + "fields": { + "start": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "end": { + "type": "string", + "id": 2 + } + } + } + } + }, + "AccountIssueService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "ListAccountIssues": { + "requestType": "ListAccountIssuesRequest", + "responseType": "ListAccountIssuesResponse", + "options": { + "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/issues", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{parent=accounts/*}/issues" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "AccountIssue": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/AccountIssue", + "(google.api.resource).pattern": "accounts/{account}/issues/{issue}", + "(google.api.resource).plural": "accountIssues", + "(google.api.resource).singular": "accountIssue" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "title": { + "type": "string", + "id": 2 + }, + "severity": { + "type": "Severity", + "id": 3 + }, + "impactedDestinations": { + "rule": "repeated", + "type": "ImpactedDestination", + "id": 4 + }, + "detail": { + "type": "string", + "id": 5 + }, + "documentationUri": { + "type": "string", + "id": 6 + } + }, + "nested": { + "ImpactedDestination": { + "oneofs": { + "_reportingContext": { + "oneof": [ + "reportingContext" + ] + } + }, + "fields": { + "reportingContext": { + "type": "google.shopping.type.ReportingContext.ReportingContextEnum", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "impacts": { + "rule": "repeated", + "type": "Impact", + "id": 2 + } + }, + "nested": { + "Impact": { + "fields": { + "regionCode": { + "type": "string", + "id": 1 + }, + "severity": { + "type": "Severity", + "id": 2 + } + } + } + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "CRITICAL": 1, + "ERROR": 2, + "SUGGESTION": 3 + } + } + } + }, + "ListAccountIssuesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZone": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAccountIssuesResponse": { + "fields": { + "accountIssues": { + "rule": "repeated", + "type": "AccountIssue", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "AccountsService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetAccount": { + "requestType": "GetAccountRequest", + "responseType": "Account", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAndConfigureAccount": { + "requestType": "CreateAndConfigureAccountRequest", + "responseType": "Account", + "options": { + "(google.api.http).post": "/accounts/v1beta/accounts:createAndConfigure", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/accounts/v1beta/accounts:createAndConfigure", + "body": "*" + } + } + ] + }, + "DeleteAccount": { + "requestType": "DeleteAccountRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/accounts/v1beta/{name=accounts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/accounts/v1beta/{name=accounts/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateAccount": { + "requestType": "UpdateAccountRequest", + "responseType": "Account", + "options": { + "(google.api.http).patch": "/accounts/v1beta/{account.name=accounts/*}", + "(google.api.http).body": "account", + "(google.api.method_signature)": "account,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/accounts/v1beta/{account.name=accounts/*}", + "body": "account" + } + }, + { + "(google.api.method_signature)": "account,update_mask" + } + ] + }, + "ListAccounts": { + "requestType": "ListAccountsRequest", + "responseType": "ListAccountsResponse", + "options": { + "(google.api.http).get": "/accounts/v1beta/accounts" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/accounts" + } + } + ] + }, + "ListSubAccounts": { + "requestType": "ListSubAccountsRequest", + "responseType": "ListSubAccountsResponse", + "options": { + "(google.api.http).get": "/accounts/v1beta/{provider=accounts/*}:listSubaccounts", + "(google.api.method_signature)": "provider" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{provider=accounts/*}:listSubaccounts" + } + }, + { + "(google.api.method_signature)": "provider" + } + ] + } + } + }, + "Account": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/Account", + "(google.api.resource).pattern": "accounts/{account}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "accountId": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accountName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "adultContent": { + "type": "bool", + "id": 4 + }, + "testAccount": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "timeZone": { + "type": "google.type.TimeZone", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAccountRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + } + } + }, + "CreateAndConfigureAccountRequest": { + "oneofs": { + "_acceptTermsOfService": { + "oneof": [ + "acceptTermsOfService" + ] + } + }, + "fields": { + "account": { + "type": "Account", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "users": { + "rule": "repeated", + "type": "CreateUserRequest", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "acceptTermsOfService": { + "type": "AcceptTermsOfService", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "service": { + "rule": "repeated", + "type": "AddAccountService", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "AcceptTermsOfService": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" + } + }, + "regionCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddAccountService": { + "oneofs": { + "serviceType": { + "oneof": [ + "accountAggregation" + ] + }, + "_provider": { + "oneof": [ + "provider" + ] + } + }, + "fields": { + "accountAggregation": { + "type": "AccountAggregation", + "id": 103 + }, + "provider": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account", + "proto3_optional": true + } + } + } + } + } + }, + "DeleteAccountRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + } + } + }, + "UpdateAccountRequest": { + "fields": { + "account": { + "type": "Account", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListAccountsRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAccountsResponse": { + "fields": { + "accounts": { + "rule": "repeated", + "type": "Account", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListSubAccountsRequest": { + "fields": { + "provider": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSubAccountsResponse": { + "fields": { + "accounts": { + "rule": "repeated", + "type": "Account", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "AccountAggregation": { + "fields": {} + }, + "UserService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetUser": { + "requestType": "GetUserRequest", + "responseType": "User", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateUser": { + "requestType": "CreateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).post": "/accounts/v1beta/{parent=accounts/*}/users", + "(google.api.http).body": "user", + "(google.api.method_signature)": "parent,user" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/accounts/v1beta/{parent=accounts/*}/users", + "body": "user" + } + }, + { + "(google.api.method_signature)": "parent,user" + } + ] + }, + "DeleteUser": { + "requestType": "DeleteUserRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/accounts/v1beta/{name=accounts/*/users/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/accounts/v1beta/{name=accounts/*/users/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateUser": { + "requestType": "UpdateUserRequest", + "responseType": "User", + "options": { + "(google.api.http).patch": "/accounts/v1beta/{user.name=accounts/*/users/*}", + "(google.api.http).body": "user", + "(google.api.method_signature)": "user,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/accounts/v1beta/{user.name=accounts/*/users/*}", + "body": "user" + } + }, + { + "(google.api.method_signature)": "user,update_mask" + } + ] + }, + "ListUsers": { + "requestType": "ListUsersRequest", + "responseType": "ListUsersResponse", + "options": { + "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/users", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{parent=accounts/*}/users" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "User": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/User", + "(google.api.resource).pattern": "accounts/{account}/users/{email}", + "(google.api.resource).plural": "users", + "(google.api.resource).singular": "user" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accessRights": { + "rule": "repeated", + "type": "AccessRight", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "VERIFIED": 2 + } + } + } + }, + "GetUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/User" + } + } + } + }, + "CreateUserRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + }, + "userId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "user": { + "type": "User", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteUserRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/User" + } + } + } + }, + "UpdateUserRequest": { + "fields": { + "user": { + "type": "User", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListUsersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListUsersResponse": { + "fields": { + "users": { + "rule": "repeated", + "type": "User", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "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", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetBusinessIdentity": { + "requestType": "GetBusinessIdentityRequest", + "responseType": "BusinessIdentity", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/businessIdentity}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/businessIdentity}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBusinessIdentity": { + "requestType": "UpdateBusinessIdentityRequest", + "responseType": "BusinessIdentity", + "options": { + "(google.api.http).patch": "/accounts/v1beta/{business_identity.name=accounts/*/businessIdentity}", + "(google.api.http).body": "business_identity", + "(google.api.method_signature)": "business_identity,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/accounts/v1beta/{business_identity.name=accounts/*/businessIdentity}", + "body": "business_identity" + } + }, + { + "(google.api.method_signature)": "business_identity,update_mask" + } + ] + } + } + }, + "BusinessIdentity": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/BusinessIdentity", + "(google.api.resource).pattern": "accounts/{account}/businessIdentity", + "(google.api.resource).plural": "businessIdentities", + "(google.api.resource).singular": "businessIdentity" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "promotionsConsent": { + "type": "PromotionsConsent", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "blackOwned": { + "type": "IdentityAttribute", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "womenOwned": { + "type": "IdentityAttribute", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "veteranOwned": { + "type": "IdentityAttribute", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "latinoOwned": { + "type": "IdentityAttribute", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "smallBusiness": { + "type": "IdentityAttribute", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "IdentityAttribute": { + "fields": { + "identityDeclaration": { + "type": "IdentityDeclaration", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "IdentityDeclaration": { + "values": { + "IDENTITY_DECLARATION_UNSPECIFIED": 0, + "SELF_IDENTIFIES_AS": 1, + "DOES_NOT_SELF_IDENTIFY_AS": 2 + } + } + } + }, + "PromotionsConsent": { + "values": { + "PROMOTIONS_CONSENT_UNSPECIFIED": 0, + "PROMOTIONS_CONSENT_GIVEN": 1, + "PROMOTIONS_CONSENT_DENIED": 2 + } + } + } + }, + "GetBusinessIdentityRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/BusinessIdentity" + } + } + } + }, + "UpdateBusinessIdentityRequest": { + "fields": { + "businessIdentity": { + "type": "BusinessIdentity", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BusinessInfoService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetBusinessInfo": { + "requestType": "GetBusinessInfoRequest", + "responseType": "BusinessInfo", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/businessInfo}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/businessInfo}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBusinessInfo": { + "requestType": "UpdateBusinessInfoRequest", + "responseType": "BusinessInfo", + "options": { + "(google.api.http).patch": "/accounts/v1beta/{business_info.name=accounts/*/businessInfo}", + "(google.api.http).body": "business_info", + "(google.api.method_signature)": "business_info,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/accounts/v1beta/{business_info.name=accounts/*/businessInfo}", + "body": "business_info" + } + }, + { + "(google.api.method_signature)": "business_info,update_mask" + } + ] + } + } + }, + "BusinessInfo": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/BusinessInfo", + "(google.api.resource).pattern": "accounts/{account}/businessInfo", + "(google.api.resource).plural": "businessInfos", + "(google.api.resource).singular": "businessInfo" + }, + "oneofs": { + "_address": { + "oneof": [ + "address" + ] + }, + "_phone": { + "oneof": [ + "phone" + ] + }, + "_phoneVerificationState": { + "oneof": [ + "phoneVerificationState" + ] + }, + "_customerService": { + "oneof": [ + "customerService" + ] + }, + "_koreanBusinessRegistrationNumber": { + "oneof": [ + "koreanBusinessRegistrationNumber" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "address": { + "type": "google.type.PostalAddress", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "phone": { + "type": "google.type.PhoneNumber", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "phoneVerificationState": { + "type": "PhoneVerificationState", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "customerService": { + "type": "CustomerService", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "koreanBusinessRegistrationNumber": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "GetBusinessInfoRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/BusinessInfo" + } + } + } + }, + "UpdateBusinessInfoRequest": { + "fields": { + "businessInfo": { + "type": "BusinessInfo", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CustomerService": { + "oneofs": { + "_uri": { + "oneof": [ + "uri" + ] + }, + "_email": { + "oneof": [ + "email" + ] + }, + "_phone": { + "oneof": [ + "phone" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "email": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "phone": { + "type": "google.type.PhoneNumber", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "PhoneVerificationState": { + "values": { + "PHONE_VERIFICATION_STATE_UNSPECIFIED": 0, + "PHONE_VERIFICATION_STATE_VERIFIED": 1, + "PHONE_VERIFICATION_STATE_UNVERIFIED": 2 + } + }, + "EmailPreferencesService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetEmailPreferences": { + "requestType": "GetEmailPreferencesRequest", + "responseType": "EmailPreferences", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/users/*/emailPreferences}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/users/*/emailPreferences}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateEmailPreferences": { + "requestType": "UpdateEmailPreferencesRequest", + "responseType": "EmailPreferences", + "options": { + "(google.api.http).patch": "/accounts/v1beta/{email_preferences.name=accounts/*/users/*/emailPreferences}", + "(google.api.http).body": "email_preferences", + "(google.api.method_signature)": "email_preferences,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/accounts/v1beta/{email_preferences.name=accounts/*/users/*/emailPreferences}", + "body": "email_preferences" + } + }, + { + "(google.api.method_signature)": "email_preferences,update_mask" + } + ] + } + } + }, + "EmailPreferences": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/EmailPreferences", + "(google.api.resource).pattern": "accounts/{account}/users/{email}/emailPreferences", + "(google.api.resource).plural": "emailPreferences", + "(google.api.resource).singular": "emailPreferences" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "newsAndTips": { + "type": "OptInState", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OptInState": { + "values": { + "OPT_IN_STATE_UNSPECIFIED": 0, + "OPTED_OUT": 1, + "OPTED_IN": 2, + "UNCONFIRMED": 3 + } + } + } + }, + "GetEmailPreferencesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/EmailPreferences" + } + } + } + }, + "UpdateEmailPreferencesRequest": { + "fields": { + "emailPreferences": { + "type": "EmailPreferences", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "HomepageService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetHomepage": { + "requestType": "GetHomepageRequest", + "responseType": "Homepage", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/homepage}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/homepage}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateHomepage": { + "requestType": "UpdateHomepageRequest", + "responseType": "Homepage", + "options": { + "(google.api.http).patch": "/accounts/v1beta/{homepage.name=accounts/*/homepage}", + "(google.api.http).body": "homepage", + "(google.api.method_signature)": "homepage,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/accounts/v1beta/{homepage.name=accounts/*/homepage}", + "body": "homepage" + } + }, + { + "(google.api.method_signature)": "homepage,update_mask" + } + ] + }, + "ClaimHomepage": { + "requestType": "ClaimHomepageRequest", + "responseType": "Homepage", + "options": { + "(google.api.http).post": "/accounts/v1beta/{name=accounts/*/homepage}:claim", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/accounts/v1beta/{name=accounts/*/homepage}:claim", + "body": "*" + } + } + ] + }, + "UnclaimHomepage": { + "requestType": "UnclaimHomepageRequest", + "responseType": "Homepage", + "options": { + "(google.api.http).post": "/accounts/v1beta/{name=accounts/*/homepage}:unclaim", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/accounts/v1beta/{name=accounts/*/homepage}:unclaim", + "body": "*" + } + } + ] + } + } + }, + "Homepage": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/Homepage", + "(google.api.resource).pattern": "accounts/{account}/homepage", + "(google.api.resource).plural": "homepages", + "(google.api.resource).singular": "homepage" + }, + "oneofs": { + "_uri": { + "oneof": [ + "uri" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "uri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "claimed": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetHomepageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Homepage" + } + } + } + }, + "UpdateHomepageRequest": { + "fields": { + "homepage": { + "type": "Homepage", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ClaimHomepageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Homepage" + } + } + } + }, + "UnclaimHomepageRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Homepage" + } + } + } + }, + "OnlineReturnPolicyService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetOnlineReturnPolicy": { + "requestType": "GetOnlineReturnPolicyRequest", + "responseType": "OnlineReturnPolicy", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/onlineReturnPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/onlineReturnPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListOnlineReturnPolicies": { + "requestType": "ListOnlineReturnPoliciesRequest", + "responseType": "ListOnlineReturnPoliciesResponse", + "options": { + "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/onlineReturnPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{parent=accounts/*}/onlineReturnPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "GetOnlineReturnPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/OnlineReturnPolicy" + } + } + } + }, + "ListOnlineReturnPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "merchantapi.googleapis.com/OnlineReturnPolicy" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListOnlineReturnPoliciesResponse": { + "fields": { + "onlineReturnPolicies": { + "rule": "repeated", + "type": "OnlineReturnPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "OnlineReturnPolicy": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/OnlineReturnPolicy", + "(google.api.resource).pattern": "accounts/{account}/onlineReturnPolicies/{return_policy}", + "(google.api.resource).plural": "onlineReturnPolicies", + "(google.api.resource).singular": "onlineReturnPolicy" + }, + "oneofs": { + "_acceptDefectiveOnly": { + "oneof": [ + "acceptDefectiveOnly" + ] + }, + "_processRefundDays": { + "oneof": [ + "processRefundDays" + ] + }, + "_acceptExchange": { + "oneof": [ + "acceptExchange" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "returnPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "label": { + "type": "string", + "id": 3 + }, + "countries": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "policy": { + "type": "Policy", + "id": 5 + }, + "restockingFee": { + "type": "RestockingFee", + "id": 6 + }, + "returnMethods": { + "rule": "repeated", + "type": "ReturnMethod", + "id": 7 + }, + "itemConditions": { + "rule": "repeated", + "type": "ItemCondition", + "id": 8 + }, + "returnShippingFee": { + "type": "ReturnShippingFee", + "id": 9 + }, + "returnPolicyUri": { + "type": "string", + "id": 10 + }, + "acceptDefectiveOnly": { + "type": "bool", + "id": 11, + "options": { + "proto3_optional": true + } + }, + "processRefundDays": { + "type": "int32", + "id": 12, + "options": { + "proto3_optional": true + } + }, + "acceptExchange": { + "type": "bool", + "id": 13, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "ReturnShippingFee": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "fixedFee": { + "type": "google.shopping.type.Price", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "FIXED": 1, + "CUSTOMER_PAYING_ACTUAL_FEE": 2 + } + } + } + }, + "RestockingFee": { + "oneofs": { + "type": { + "oneof": [ + "fixedFee", + "microPercent" + ] + } + }, + "fields": { + "fixedFee": { + "type": "google.shopping.type.Price", + "id": 1 + }, + "microPercent": { + "type": "int32", + "id": 2 + } + } + }, + "Policy": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "days": { + "type": "int64", + "id": 2 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "NUMBER_OF_DAYS_AFTER_DELIVERY": 1, + "NO_RETURNS": 2, + "LIFETIME_RETURNS": 3 + } + } + } + }, + "ReturnMethod": { + "values": { + "RETURN_METHOD_UNSPECIFIED": 0, + "BY_MAIL": 1, + "IN_STORE": 2, + "AT_A_KIOSK": 3 + } + }, + "ItemCondition": { + "values": { + "ITEM_CONDITION_UNSPECIFIED": 0, + "NEW": 1, + "USED": 2 + } + } + } + }, + "ProgramsService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetProgram": { + "requestType": "GetProgramRequest", + "responseType": "Program", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/programs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/programs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPrograms": { + "requestType": "ListProgramsRequest", + "responseType": "ListProgramsResponse", + "options": { + "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/programs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{parent=accounts/*}/programs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "EnableProgram": { + "requestType": "EnableProgramRequest", + "responseType": "Program", + "options": { + "(google.api.http).post": "/accounts/v1beta/{name=accounts/*/programs/*}:enable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/accounts/v1beta/{name=accounts/*/programs/*}:enable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DisableProgram": { + "requestType": "DisableProgramRequest", + "responseType": "Program", + "options": { + "(google.api.http).post": "/accounts/v1beta/{name=accounts/*/programs/*}:disable", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/accounts/v1beta/{name=accounts/*/programs/*}:disable", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Program": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/Program", + "(google.api.resource).pattern": "accounts/{account}/programs/{program}", + "(google.api.resource).plural": "programs", + "(google.api.resource).singular": "program" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "documentationUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "activeRegionCodes": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unmetRequirements": { + "rule": "repeated", + "type": "Requirement", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Requirement": { + "fields": { + "title": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentationUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "affectedRegionCodes": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "NOT_ELIGIBLE": 1, + "ELIGIBLE": 2, + "ENABLED": 3 + } + } + } + }, + "GetProgramRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Program" + } + } + } + }, + "ListProgramsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "merchantapi.googleapis.com/Program" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListProgramsResponse": { + "fields": { + "programs": { + "rule": "repeated", + "type": "Program", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "EnableProgramRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Program" + } + } + } + }, + "DisableProgramRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Program" + } + } + } + }, + "RegionsService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetRegion": { + "requestType": "GetRegionRequest", + "responseType": "Region", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/regions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/regions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateRegion": { + "requestType": "CreateRegionRequest", + "responseType": "Region", + "options": { + "(google.api.http).post": "/accounts/v1beta/{parent=accounts/*}/regions", + "(google.api.http).body": "region", + "(google.api.method_signature)": "parent,region,region_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/accounts/v1beta/{parent=accounts/*}/regions", + "body": "region" + } + }, + { + "(google.api.method_signature)": "parent,region,region_id" + } + ] + }, + "UpdateRegion": { + "requestType": "UpdateRegionRequest", + "responseType": "Region", + "options": { + "(google.api.http).patch": "/accounts/v1beta/{region.name=accounts/*/regions/*}", + "(google.api.http).body": "region", + "(google.api.method_signature)": "region,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/accounts/v1beta/{region.name=accounts/*/regions/*}", + "body": "region" + } + }, + { + "(google.api.method_signature)": "region,update_mask" + } + ] + }, + "DeleteRegion": { + "requestType": "DeleteRegionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/accounts/v1beta/{name=accounts/*/regions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/accounts/v1beta/{name=accounts/*/regions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRegions": { + "requestType": "ListRegionsRequest", + "responseType": "ListRegionsResponse", + "options": { + "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/regions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{parent=accounts/*}/regions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "GetRegionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Region" + } + } + } + }, + "CreateRegionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + }, + "regionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "Region", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateRegionRequest": { + "fields": { + "region": { + "type": "Region", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteRegionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Region" + } + } + } + }, + "ListRegionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRegionsResponse": { + "fields": { + "regions": { + "rule": "repeated", + "type": "Region", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Region": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/Region", + "(google.api.resource).pattern": "accounts/{account}/regions/{region}", + "(google.api.resource).plural": "regions", + "(google.api.resource).singular": "region" + }, + "oneofs": { + "_displayName": { + "oneof": [ + "displayName" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "postalCodeArea": { + "type": "PostalCodeArea", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "geotargetArea": { + "type": "GeoTargetArea", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "regionalInventoryEligible": { + "type": "google.protobuf.BoolValue", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "shippingEligible": { + "type": "google.protobuf.BoolValue", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "PostalCodeArea": { + "fields": { + "regionCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "postalCodes": { + "rule": "repeated", + "type": "PostalCodeRange", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "PostalCodeRange": { + "fields": { + "begin": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "end": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "GeoTargetArea": { + "fields": { + "geotargetCriteriaIds": { + "rule": "repeated", + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ShippingSettingsService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetShippingSettings": { + "requestType": "GetShippingSettingsRequest", + "responseType": "ShippingSettings", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/shippingSettings}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/shippingSettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "InsertShippingSettings": { + "requestType": "InsertShippingSettingsRequest", + "responseType": "ShippingSettings", + "options": { + "(google.api.http).post": "/accounts/v1beta/{parent=accounts/*}/shippingSettings:insert", + "(google.api.http).body": "shipping_setting" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/accounts/v1beta/{parent=accounts/*}/shippingSettings:insert", + "body": "shipping_setting" + } + } + ] + } + } + }, + "ShippingSettings": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/ShippingSettings", + "(google.api.resource).pattern": "accounts/{account}/shippingSettings", + "(google.api.resource).plural": "shippingSettings", + "(google.api.resource).singular": "shippingSettings" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "services": { + "rule": "repeated", + "type": "Service", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "warehouses": { + "rule": "repeated", + "type": "Warehouse", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Service": { + "oneofs": { + "_serviceName": { + "oneof": [ + "serviceName" + ] + }, + "_active": { + "oneof": [ + "active" + ] + }, + "_currencyCode": { + "oneof": [ + "currencyCode" + ] + }, + "_deliveryTime": { + "oneof": [ + "deliveryTime" + ] + }, + "_shipmentType": { + "oneof": [ + "shipmentType" + ] + }, + "_minimumOrderValue": { + "oneof": [ + "minimumOrderValue" + ] + }, + "_minimumOrderValueTable": { + "oneof": [ + "minimumOrderValueTable" + ] + }, + "_storeConfig": { + "oneof": [ + "storeConfig" + ] + } + }, + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "active": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "deliveryCountries": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "currencyCode": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "deliveryTime": { + "type": "DeliveryTime", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "rateGroups": { + "rule": "repeated", + "type": "RateGroup", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "shipmentType": { + "type": "ShipmentType", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "minimumOrderValue": { + "type": "google.shopping.type.Price", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "minimumOrderValueTable": { + "type": "MinimumOrderValueTable", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "storeConfig": { + "type": "StoreConfig", + "id": 10, + "options": { + "proto3_optional": true + } + }, + "loyaltyPrograms": { + "rule": "repeated", + "type": "LoyaltyProgram", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "StoreConfig": { + "oneofs": { + "_storeServiceType": { + "oneof": [ + "storeServiceType" + ] + }, + "_cutoffConfig": { + "oneof": [ + "cutoffConfig" + ] + }, + "_serviceRadius": { + "oneof": [ + "serviceRadius" + ] + } + }, + "fields": { + "storeServiceType": { + "type": "StoreServiceType", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "storeCodes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cutoffConfig": { + "type": "CutoffConfig", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "serviceRadius": { + "type": "Distance", + "id": 4, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "CutoffConfig": { + "oneofs": { + "_localCutoffTime": { + "oneof": [ + "localCutoffTime" + ] + }, + "_storeCloseOffsetHours": { + "oneof": [ + "storeCloseOffsetHours" + ] + }, + "_noDeliveryPostCutoff": { + "oneof": [ + "noDeliveryPostCutoff" + ] + } + }, + "fields": { + "localCutoffTime": { + "type": "LocalCutoffTime", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "storeCloseOffsetHours": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "noDeliveryPostCutoff": { + "type": "bool", + "id": 3, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "LocalCutoffTime": { + "oneofs": { + "_hour": { + "oneof": [ + "hour" + ] + }, + "_minute": { + "oneof": [ + "minute" + ] + } + }, + "fields": { + "hour": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "minute": { + "type": "int64", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "StoreServiceType": { + "values": { + "STORE_SERVICE_TYPE_UNSPECIFIED": 0, + "ALL_STORES": 1, + "SELECTED_STORES": 2 + } + } + } + }, + "LoyaltyProgram": { + "oneofs": { + "_programLabel": { + "oneof": [ + "programLabel" + ] + } + }, + "fields": { + "programLabel": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "loyaltyProgramTiers": { + "rule": "repeated", + "type": "LoyaltyProgramTiers", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LoyaltyProgramTiers": { + "oneofs": { + "_tierLabel": { + "oneof": [ + "tierLabel" + ] + } + }, + "fields": { + "tierLabel": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "ShipmentType": { + "values": { + "SHIPMENT_TYPE_UNSPECIFIED": 0, + "DELIVERY": 1, + "LOCAL_DELIVERY": 2, + "COLLECTION_POINT": 3 + } + } + } + }, + "Distance": { + "oneofs": { + "_value": { + "oneof": [ + "value" + ] + }, + "_unit": { + "oneof": [ + "unit" + ] + } + }, + "fields": { + "value": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "unit": { + "type": "Unit", + "id": 2, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Unit": { + "values": { + "UNIT_UNSPECIFIED": 0, + "MILES": 1, + "KILOMETERS": 2 + } + } + } + }, + "Warehouse": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_shippingAddress": { + "oneof": [ + "shippingAddress" + ] + }, + "_cutoffTime": { + "oneof": [ + "cutoffTime" + ] + }, + "_handlingDays": { + "oneof": [ + "handlingDays" + ] + }, + "_businessDayConfig": { + "oneof": [ + "businessDayConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "shippingAddress": { + "type": "Address", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "cutoffTime": { + "type": "WarehouseCutoffTime", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "handlingDays": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "businessDayConfig": { + "type": "BusinessDayConfig", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "WarehouseCutoffTime": { + "oneofs": { + "_hour": { + "oneof": [ + "hour" + ] + }, + "_minute": { + "oneof": [ + "minute" + ] + } + }, + "fields": { + "hour": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "minute": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "Address": { + "oneofs": { + "_streetAddress": { + "oneof": [ + "streetAddress" + ] + }, + "_city": { + "oneof": [ + "city" + ] + }, + "_administrativeArea": { + "oneof": [ + "administrativeArea" + ] + }, + "_postalCode": { + "oneof": [ + "postalCode" + ] + }, + "_regionCode": { + "oneof": [ + "regionCode" + ] + } + }, + "fields": { + "streetAddress": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "city": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "administrativeArea": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "postalCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "regionCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "DeliveryTime": { + "oneofs": { + "_minTransitDays": { + "oneof": [ + "minTransitDays" + ] + }, + "_maxTransitDays": { + "oneof": [ + "maxTransitDays" + ] + }, + "_cutoffTime": { + "oneof": [ + "cutoffTime" + ] + }, + "_minHandlingDays": { + "oneof": [ + "minHandlingDays" + ] + }, + "_maxHandlingDays": { + "oneof": [ + "maxHandlingDays" + ] + }, + "_transitTimeTable": { + "oneof": [ + "transitTimeTable" + ] + }, + "_handlingBusinessDayConfig": { + "oneof": [ + "handlingBusinessDayConfig" + ] + }, + "_transitBusinessDayConfig": { + "oneof": [ + "transitBusinessDayConfig" + ] + } + }, + "fields": { + "minTransitDays": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "maxTransitDays": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "cutoffTime": { + "type": "CutoffTime", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "minHandlingDays": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "maxHandlingDays": { + "type": "int32", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "transitTimeTable": { + "type": "TransitTable", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "handlingBusinessDayConfig": { + "type": "BusinessDayConfig", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "transitBusinessDayConfig": { + "type": "BusinessDayConfig", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "warehouseBasedDeliveryTimes": { + "rule": "repeated", + "type": "WarehouseBasedDeliveryTime", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CutoffTime": { + "oneofs": { + "_hour": { + "oneof": [ + "hour" + ] + }, + "_minute": { + "oneof": [ + "minute" + ] + }, + "_timeZone": { + "oneof": [ + "timeZone" + ] + } + }, + "fields": { + "hour": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "minute": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "timeZone": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "BusinessDayConfig": { + "fields": { + "businessDays": { + "rule": "repeated", + "type": "Weekday", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Weekday": { + "values": { + "WEEKDAY_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + } + } + }, + "WarehouseBasedDeliveryTime": { + "oneofs": { + "_carrier": { + "oneof": [ + "carrier" + ] + }, + "_carrierService": { + "oneof": [ + "carrierService" + ] + }, + "_warehouse": { + "oneof": [ + "warehouse" + ] + } + }, + "fields": { + "carrier": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "carrierService": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "warehouse": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "RateGroup": { + "oneofs": { + "_singleValue": { + "oneof": [ + "singleValue" + ] + }, + "_mainTable": { + "oneof": [ + "mainTable" + ] + }, + "_name": { + "oneof": [ + "name" + ] + } + }, + "fields": { + "applicableShippingLabels": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "singleValue": { + "type": "Value", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "mainTable": { + "type": "Table", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "subtables": { + "rule": "repeated", + "type": "Table", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "carrierRates": { + "rule": "repeated", + "type": "CarrierRate", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Table": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_rowHeaders": { + "oneof": [ + "rowHeaders" + ] + }, + "_columnHeaders": { + "oneof": [ + "columnHeaders" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "rowHeaders": { + "type": "Headers", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "columnHeaders": { + "type": "Headers", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "rows": { + "rule": "repeated", + "type": "Row", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TransitTable": { + "fields": { + "postalCodeGroupNames": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "transitTimeLabels": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "rows": { + "rule": "repeated", + "type": "TransitTimeRow", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "TransitTimeRow": { + "fields": { + "values": { + "rule": "repeated", + "type": "TransitTimeValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "TransitTimeValue": { + "oneofs": { + "_minTransitDays": { + "oneof": [ + "minTransitDays" + ] + }, + "_maxTransitDays": { + "oneof": [ + "maxTransitDays" + ] + } + }, + "fields": { + "minTransitDays": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "maxTransitDays": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + } + } + }, + "MinimumOrderValueTable": { + "fields": { + "storeCodeSetWithMovs": { + "rule": "repeated", + "type": "StoreCodeSetWithMov", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "StoreCodeSetWithMov": { + "oneofs": { + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "storeCodes": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "value": { + "type": "google.shopping.type.Price", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "Headers": { + "fields": { + "prices": { + "rule": "repeated", + "type": "google.shopping.type.Price", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "weights": { + "rule": "repeated", + "type": "google.shopping.type.Weight", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "numberOfItems": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "postalCodeGroupNames": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "locations": { + "rule": "repeated", + "type": "LocationIdSet", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "LocationIdSet": { + "fields": { + "locationIds": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Row": { + "fields": { + "cells": { + "rule": "repeated", + "type": "Value", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Value": { + "oneofs": { + "_noShipping": { + "oneof": [ + "noShipping" + ] + }, + "_flatRate": { + "oneof": [ + "flatRate" + ] + }, + "_pricePercentage": { + "oneof": [ + "pricePercentage" + ] + }, + "_carrierRate": { + "oneof": [ + "carrierRate" + ] + }, + "_subtable": { + "oneof": [ + "subtable" + ] + } + }, + "fields": { + "noShipping": { + "type": "bool", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "flatRate": { + "type": "google.shopping.type.Price", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "pricePercentage": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "carrierRate": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "subtable": { + "type": "string", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "CarrierRate": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_carrier": { + "oneof": [ + "carrier" + ] + }, + "_carrierService": { + "oneof": [ + "carrierService" + ] + }, + "_originPostalCode": { + "oneof": [ + "originPostalCode" + ] + }, + "_percentageAdjustment": { + "oneof": [ + "percentageAdjustment" + ] + }, + "_flatAdjustment": { + "oneof": [ + "flatAdjustment" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "carrier": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "carrierService": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "originPostalCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "percentageAdjustment": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "flatAdjustment": { + "type": "google.shopping.type.Price", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "GetShippingSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/ShippingSettings" + } + } + } + }, + "InsertShippingSettingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "shippingSetting": { + "type": "ShippingSettings", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TermsOfServiceService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetTermsOfService": { + "requestType": "GetTermsOfServiceRequest", + "responseType": "TermsOfService", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=termsOfService/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=termsOfService/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RetrieveLatestTermsOfService": { + "requestType": "RetrieveLatestTermsOfServiceRequest", + "responseType": "TermsOfService", + "options": { + "(google.api.http).get": "/accounts/v1beta/termsOfService:retrieveLatest" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/termsOfService:retrieveLatest" + } + } + ] + }, + "AcceptTermsOfService": { + "requestType": "AcceptTermsOfServiceRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=termsOfService/*}:accept", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=termsOfService/*}:accept" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "TermsOfService": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/TermsOfService", + "(google.api.resource).pattern": "termsOfService/{version}" + }, + "oneofs": { + "_fileUri": { + "oneof": [ + "fileUri" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" + } + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "kind": { + "type": "TermsOfServiceKind", + "id": 3 + }, + "fileUri": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "external": { + "type": "bool", + "id": 5 + } + } + }, + "GetTermsOfServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" + } + } + } + }, + "RetrieveLatestTermsOfServiceRequest": { + "fields": { + "regionCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kind": { + "type": "TermsOfServiceKind", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AcceptTermsOfServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" + } + }, + "account": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + }, + "regionCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TermsOfServiceKind": { + "values": { + "TERMS_OF_SERVICE_KIND_UNSPECIFIED": 0, + "MERCHANT_CENTER": 1 + } + }, + "TermsOfServiceAgreementStateService": { + "options": { + "(google.api.default_host)": "merchantapi.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" + }, + "methods": { + "GetTermsOfServiceAgreementState": { + "requestType": "GetTermsOfServiceAgreementStateRequest", + "responseType": "TermsOfServiceAgreementState", + "options": { + "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/termsOfServiceAgreementStates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{name=accounts/*/termsOfServiceAgreementStates/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RetrieveForApplicationTermsOfServiceAgreementState": { + "requestType": "RetrieveForApplicationTermsOfServiceAgreementStateRequest", + "responseType": "TermsOfServiceAgreementState", + "options": { + "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/termsOfServiceAgreementStates:retrieveForApplication", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/accounts/v1beta/{parent=accounts/*}/termsOfServiceAgreementStates:retrieveForApplication" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "TermsOfServiceAgreementState": { + "options": { + "(google.api.resource).type": "merchantapi.googleapis.com/TermsOfServiceAgreementState", + "(google.api.resource).pattern": "accounts/{account}/termsOfServiceAgreementStates/{identifier}", + "(google.api.resource).plural": "termsOfServiceAgreementStates", + "(google.api.resource).singular": "termsOfServiceAgreementState" + }, + "oneofs": { + "_accepted": { + "oneof": [ + "accepted" + ] + }, + "_required": { + "oneof": [ + "required" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "termsOfServiceKind": { + "type": "TermsOfServiceKind", + "id": 3 + }, + "accepted": { + "type": "Accepted", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "required": { + "type": "Required", + "id": 5, + "options": { + "proto3_optional": true + } + } + } + }, + "Accepted": { + "oneofs": { + "_validUntil": { + "oneof": [ + "validUntil" + ] + } + }, + "fields": { + "termsOfService": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" + } + }, + "acceptedBy": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" + } + }, + "validUntil": { + "type": "google.type.Date", + "id": 3, + "options": { + "proto3_optional": true + } + } + } + }, + "Required": { + "fields": { + "termsOfService": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" + } + }, + "tosFileUri": { + "type": "string", + "id": 2 + } + } + }, + "GetTermsOfServiceAgreementStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfServiceAgreementState" + } + } + } + }, + "RetrieveForApplicationTermsOfServiceAgreementStateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "merchantapi.googleapis.com/TermsOfServiceAgreementState" + } + } + } + } + } + } + } + } + } + }, + "type": { + "options": { + "csharp_namespace": "Google.Shopping.Type", + "go_package": "cloud.google.com/go/shopping/type/typepb;typepb", + "java_multiple_files": true, + "java_outer_classname": "TypesProto", + "java_package": "com.google.shopping.type" + }, + "nested": { + "Weight": { + "oneofs": { + "_amountMicros": { + "oneof": [ + "amountMicros" + ] + } + }, + "fields": { + "amountMicros": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "unit": { + "type": "WeightUnit", + "id": 2 + } + }, + "nested": { + "WeightUnit": { + "values": { + "WEIGHT_UNIT_UNSPECIFIED": 0, + "POUND": 1, + "KILOGRAM": 2 + } + } + } + }, + "Price": { + "oneofs": { + "_amountMicros": { + "oneof": [ + "amountMicros" + ] + }, + "_currencyCode": { + "oneof": [ + "currencyCode" + ] + } + }, + "fields": { + "amountMicros": { + "type": "int64", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "currencyCode": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "CustomAttribute": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "groupValues": { + "rule": "repeated", + "type": "CustomAttribute", + "id": 3 + } + } + }, + "Destination": { + "fields": {}, + "nested": { + "DestinationEnum": { + "values": { + "DESTINATION_ENUM_UNSPECIFIED": 0, + "SHOPPING_ADS": 1, + "DISPLAY_ADS": 2, + "LOCAL_INVENTORY_ADS": 3, + "FREE_LISTINGS": 4, + "FREE_LOCAL_LISTINGS": 5, + "YOUTUBE_SHOPPING": 6 + } + } + } + }, + "ReportingContext": { + "fields": {}, + "nested": { + "ReportingContextEnum": { + "valuesOptions": { + "DISCOVERY_ADS": { + "deprecated": true + } + }, + "values": { + "REPORTING_CONTEXT_ENUM_UNSPECIFIED": 0, + "SHOPPING_ADS": 1, + "DISCOVERY_ADS": 2, + "DEMAND_GEN_ADS": 13, + "DEMAND_GEN_ADS_DISCOVER_SURFACE": 14, + "VIDEO_ADS": 3, + "DISPLAY_ADS": 4, + "LOCAL_INVENTORY_ADS": 5, + "VEHICLE_INVENTORY_ADS": 6, + "FREE_LISTINGS": 7, + "FREE_LOCAL_LISTINGS": 8, + "FREE_LOCAL_VEHICLE_LISTINGS": 9, + "YOUTUBE_SHOPPING": 10, + "CLOUD_RETAIL": 11, + "LOCAL_CLOUD_RETAIL": 12 + } + } + } + }, + "Channel": { + "fields": {}, + "nested": { + "ChannelEnum": { + "values": { + "CHANNEL_ENUM_UNSPECIFIED": 0, + "ONLINE": 1, + "LOCAL": 2 + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/date;date", + "java_multiple_files": true, + "java_outer_classname": "DateProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Interval": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "DateTime": { + "oneofs": { + "timeOffset": { + "oneof": [ + "utcOffset", + "timeZone" + ] + } + }, + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + }, + "hours": { + "type": "int32", + "id": 4 + }, + "minutes": { + "type": "int32", + "id": 5 + }, + "seconds": { + "type": "int32", + "id": 6 + }, + "nanos": { + "type": "int32", + "id": 7 + }, + "utcOffset": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "timeZone": { + "type": "TimeZone", + "id": 9 + } + } + }, + "TimeZone": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + } + }, + "PhoneNumber": { + "oneofs": { + "kind": { + "oneof": [ + "e164Number", + "shortCode" + ] + } + }, + "fields": { + "e164Number": { + "type": "string", + "id": 1 + }, + "shortCode": { + "type": "ShortCode", + "id": 2 + }, + "extension": { + "type": "string", + "id": 3 + } + }, + "nested": { + "ShortCode": { + "fields": { + "regionCode": { + "type": "string", + "id": 1 + }, + "number": { + "type": "string", + "id": 2 + } + } + } + } + }, + "PostalAddress": { + "fields": { + "revision": { + "type": "int32", + "id": 1 + }, + "regionCode": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + }, + "postalCode": { + "type": "string", + "id": 4 + }, + "sortingCode": { + "type": "string", + "id": 5 + }, + "administrativeArea": { + "type": "string", + "id": 6 + }, + "locality": { + "type": "string", + "id": 7 + }, + "sublocality": { + "type": "string", + "id": 8 + }, + "addressLines": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "recipients": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "organization": { + "type": "string", + "id": 11 + } + } + }, + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_issue_service.list_account_issues.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_issue_service.list_account_issues.js new file mode 100644 index 00000000000..26ab7580cda --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_issue_service.list_account_issues.js @@ -0,0 +1,90 @@ +// 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(parent) { + // [START merchantapi_v1beta_generated_AccountIssueService_ListAccountIssues_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of issues. + * Format: `accounts/{account}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of issues to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListAccountIssues` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccountIssues` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. The issues in the response will have human-readable fields in the + * 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. + */ + // const languageCode = 'abc123' + /** + * 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. + */ + // const timeZone = 'abc123' + + // Imports the Accounts library + const {AccountIssueServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountIssueServiceClient(); + + async function callListAccountIssues() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = accountsClient.listAccountIssuesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAccountIssues(); + // [END merchantapi_v1beta_generated_AccountIssueService_ListAccountIssues_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.get_account_tax.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.get_account_tax.js new file mode 100644 index 00000000000..41bf05fd6d7 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.get_account_tax.js @@ -0,0 +1,61 @@ +// 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_AccountTaxService_GetAccountTax_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name from which tax settings will be retrieved + */ + // const name = 'abc123' + + // Imports the Accounts library + const {AccountTaxServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountTaxServiceClient(); + + async function callGetAccountTax() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getAccountTax(request); + console.log(response); + } + + callGetAccountTax(); + // [END merchantapi_v1beta_generated_AccountTaxService_GetAccountTax_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.list_account_tax.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.list_account_tax.js new file mode 100644 index 00000000000..d5bdaf19232 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.list_account_tax.js @@ -0,0 +1,73 @@ +// 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(parent) { + // [START merchantapi_v1beta_generated_AccountTaxService_ListAccountTax_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of account tax. + * Format: accounts/{account} + */ + // const parent = 'abc123' + /** + * The maximum number of tax settings to return in the response, used for + * paging. + */ + // const pageSize = 1234 + /** + * The token returned by the previous request. + */ + // const pageToken = 'abc123' + + // Imports the Accounts library + const {AccountTaxServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountTaxServiceClient(); + + async function callListAccountTax() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = accountsClient.listAccountTaxAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAccountTax(); + // [END merchantapi_v1beta_generated_AccountTaxService_ListAccountTax_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.update_account_tax.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.update_account_tax.js new file mode 100644 index 00000000000..13c82cf8b3a --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.update_account_tax.js @@ -0,0 +1,65 @@ +// 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(accountTax) { + // [START merchantapi_v1beta_generated_AccountTaxService_UpdateAccountTax_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 tax setting that will be updated + */ + // const accountTax = {} + /** + * The list of fields to be updated + */ + // const updateMask = {} + + // Imports the Accounts library + const {AccountTaxServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountTaxServiceClient(); + + async function callUpdateAccountTax() { + // Construct request + const request = { + accountTax, + }; + + // Run request + const response = await accountsClient.updateAccountTax(request); + console.log(response); + } + + callUpdateAccountTax(); + // [END merchantapi_v1beta_generated_AccountTaxService_UpdateAccountTax_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.create_and_configure_account.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.create_and_configure_account.js new file mode 100644 index 00000000000..19886628937 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.create_and_configure_account.js @@ -0,0 +1,80 @@ +// 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(account, service) { + // [START merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account to be created. + */ + // const account = {} + /** + * Optional. Users to be added to the account. + */ + // const users = [1,2,3,4] + /** + * Optional. The Terms of Service (ToS) to be accepted immediately upon + * account creation. + */ + // const acceptTermsOfService = {} + /** + * 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] + + // Imports the Accounts library + const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountsServiceClient(); + + async function callCreateAndConfigureAccount() { + // Construct request + const request = { + account, + service, + }; + + // Run request + const response = await accountsClient.createAndConfigureAccount(request); + console.log(response); + } + + callCreateAndConfigureAccount(); + // [END merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.delete_account.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.delete_account.js new file mode 100644 index 00000000000..5032978f777 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.delete_account.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_AccountsService_DeleteAccount_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the account to delete. + * Format: `accounts/{account}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountsServiceClient(); + + async function callDeleteAccount() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.deleteAccount(request); + console.log(response); + } + + callDeleteAccount(); + // [END merchantapi_v1beta_generated_AccountsService_DeleteAccount_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.get_account.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.get_account.js new file mode 100644 index 00000000000..04ba41ca85b --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.get_account.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_AccountsService_GetAccount_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the account to retrieve. + * Format: `accounts/{account}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountsServiceClient(); + + async function callGetAccount() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getAccount(request); + console.log(response); + } + + callGetAccount(); + // [END merchantapi_v1beta_generated_AccountsService_GetAccount_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_accounts.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_accounts.js new file mode 100644 index 00000000000..37f2375c43a --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_accounts.js @@ -0,0 +1,78 @@ +// 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() { + // [START merchantapi_v1beta_generated_AccountsService_ListAccounts_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. + */ + /** + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Returns only accounts that match the + * filter (/merchant/api/guides/accounts/filter). + * For more details, see the + * filter syntax reference (/merchant/api/guides/accounts/filter-syntax). + */ + // const filter = 'abc123' + + // Imports the Accounts library + const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountsServiceClient(); + + async function callListAccounts() { + // Construct request + const request = { + }; + + // Run request + const iterable = accountsClient.listAccountsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAccounts(); + // [END merchantapi_v1beta_generated_AccountsService_ListAccounts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_sub_accounts.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_sub_accounts.js new file mode 100644 index 00000000000..991fac306bc --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_sub_accounts.js @@ -0,0 +1,77 @@ +// 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(provider) { + // [START merchantapi_v1beta_generated_AccountsService_ListSubAccounts_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent account. + * Format: `accounts/{account}` + */ + // const provider = 'abc123' + /** + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Accounts library + const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountsServiceClient(); + + async function callListSubAccounts() { + // Construct request + const request = { + provider, + }; + + // Run request + const iterable = accountsClient.listSubAccountsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSubAccounts(); + // [END merchantapi_v1beta_generated_AccountsService_ListSubAccounts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.update_account.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.update_account.js new file mode 100644 index 00000000000..e6a98f42c69 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.update_account.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(account, updateMask) { + // [START merchantapi_v1beta_generated_AccountsService_UpdateAccount_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 account. + */ + // const account = {} + /** + * Required. List of fields being updated. + */ + // const updateMask = {} + + // Imports the Accounts library + const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new AccountsServiceClient(); + + async function callUpdateAccount() { + // Construct request + const request = { + account, + updateMask, + }; + + // Run request + const response = await accountsClient.updateAccount(request); + console.log(response); + } + + callUpdateAccount(); + // [END merchantapi_v1beta_generated_AccountsService_UpdateAccount_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js new file mode 100644 index 00000000000..f27491c5263 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js new file mode 100644 index 00000000000..602e79cdc6a --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.get_business_identity.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.get_business_identity.js new file mode 100644 index 00000000000..6de63c9574e --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.get_business_identity.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_BusinessIdentityService_GetBusinessIdentity_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 business identity. + * Format: `accounts/{account}/businessIdentity` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {BusinessIdentityServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new BusinessIdentityServiceClient(); + + async function callGetBusinessIdentity() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getBusinessIdentity(request); + console.log(response); + } + + callGetBusinessIdentity(); + // [END merchantapi_v1beta_generated_BusinessIdentityService_GetBusinessIdentity_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.update_business_identity.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.update_business_identity.js new file mode 100644 index 00000000000..6ff89f287d2 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.update_business_identity.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(businessIdentity, updateMask) { + // [START merchantapi_v1beta_generated_BusinessIdentityService_UpdateBusinessIdentity_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 business identity. + */ + // const businessIdentity = {} + /** + * Required. List of fields being updated. + */ + // const updateMask = {} + + // Imports the Accounts library + const {BusinessIdentityServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new BusinessIdentityServiceClient(); + + async function callUpdateBusinessIdentity() { + // Construct request + const request = { + businessIdentity, + updateMask, + }; + + // Run request + const response = await accountsClient.updateBusinessIdentity(request); + console.log(response); + } + + callUpdateBusinessIdentity(); + // [END merchantapi_v1beta_generated_BusinessIdentityService_UpdateBusinessIdentity_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.get_business_info.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.get_business_info.js new file mode 100644 index 00000000000..b07cab733a8 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.get_business_info.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_BusinessInfoService_GetBusinessInfo_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 business info. + * Format: `accounts/{account}/businessInfo` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {BusinessInfoServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new BusinessInfoServiceClient(); + + async function callGetBusinessInfo() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getBusinessInfo(request); + console.log(response); + } + + callGetBusinessInfo(); + // [END merchantapi_v1beta_generated_BusinessInfoService_GetBusinessInfo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.update_business_info.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.update_business_info.js new file mode 100644 index 00000000000..d9ff567ba33 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.update_business_info.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(businessInfo, updateMask) { + // [START merchantapi_v1beta_generated_BusinessInfoService_UpdateBusinessInfo_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 business info. + */ + // const businessInfo = {} + /** + * Required. List of fields being updated. + */ + // const updateMask = {} + + // Imports the Accounts library + const {BusinessInfoServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new BusinessInfoServiceClient(); + + async function callUpdateBusinessInfo() { + // Construct request + const request = { + businessInfo, + updateMask, + }; + + // Run request + const response = await accountsClient.updateBusinessInfo(request); + console.log(response); + } + + callUpdateBusinessInfo(); + // [END merchantapi_v1beta_generated_BusinessInfoService_UpdateBusinessInfo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.get_email_preferences.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.get_email_preferences.js new file mode 100644 index 00000000000..7a2d7fe6e49 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.get_email_preferences.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_EmailPreferencesService_GetEmailPreferences_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `EmailPreferences` resource. + * Format: `accounts/{account}/users/{email}/emailPreferences` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {EmailPreferencesServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new EmailPreferencesServiceClient(); + + async function callGetEmailPreferences() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getEmailPreferences(request); + console.log(response); + } + + callGetEmailPreferences(); + // [END merchantapi_v1beta_generated_EmailPreferencesService_GetEmailPreferences_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.update_email_preferences.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.update_email_preferences.js new file mode 100644 index 00000000000..df95fc7d254 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.update_email_preferences.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(emailPreferences, updateMask) { + // [START merchantapi_v1beta_generated_EmailPreferencesService_UpdateEmailPreferences_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. Email Preferences to be updated. + */ + // const emailPreferences = {} + /** + * Required. List of fields being updated. + */ + // const updateMask = {} + + // Imports the Accounts library + const {EmailPreferencesServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new EmailPreferencesServiceClient(); + + async function callUpdateEmailPreferences() { + // Construct request + const request = { + emailPreferences, + updateMask, + }; + + // Run request + const response = await accountsClient.updateEmailPreferences(request); + console.log(response); + } + + callUpdateEmailPreferences(); + // [END merchantapi_v1beta_generated_EmailPreferencesService_UpdateEmailPreferences_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.claim_homepage.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.claim_homepage.js new file mode 100644 index 00000000000..8907fa743d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.claim_homepage.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_HomepageService_ClaimHomepage_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the homepage to claim. + * Format: `accounts/{account}/homepage` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {HomepageServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new HomepageServiceClient(); + + async function callClaimHomepage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.claimHomepage(request); + console.log(response); + } + + callClaimHomepage(); + // [END merchantapi_v1beta_generated_HomepageService_ClaimHomepage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.get_homepage.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.get_homepage.js new file mode 100644 index 00000000000..edddeb98e52 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.get_homepage.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_HomepageService_GetHomepage_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the homepage to retrieve. + * Format: `accounts/{account}/homepage` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {HomepageServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new HomepageServiceClient(); + + async function callGetHomepage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getHomepage(request); + console.log(response); + } + + callGetHomepage(); + // [END merchantapi_v1beta_generated_HomepageService_GetHomepage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.unclaim_homepage.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.unclaim_homepage.js new file mode 100644 index 00000000000..df187be8337 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.unclaim_homepage.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_HomepageService_UnclaimHomepage_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the homepage to unclaim. + * Format: `accounts/{account}/homepage` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {HomepageServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new HomepageServiceClient(); + + async function callUnclaimHomepage() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.unclaimHomepage(request); + console.log(response); + } + + callUnclaimHomepage(); + // [END merchantapi_v1beta_generated_HomepageService_UnclaimHomepage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.update_homepage.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.update_homepage.js new file mode 100644 index 00000000000..cca7b31d7c1 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.update_homepage.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(homepage, updateMask) { + // [START merchantapi_v1beta_generated_HomepageService_UpdateHomepage_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 homepage. + */ + // const homepage = {} + /** + * Required. List of fields being updated. + */ + // const updateMask = {} + + // Imports the Accounts library + const {HomepageServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new HomepageServiceClient(); + + async function callUpdateHomepage() { + // Construct request + const request = { + homepage, + updateMask, + }; + + // Run request + const response = await accountsClient.updateHomepage(request); + console.log(response); + } + + callUpdateHomepage(); + // [END merchantapi_v1beta_generated_HomepageService_UpdateHomepage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.get_online_return_policy.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.get_online_return_policy.js new file mode 100644 index 00000000000..22270390360 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.get_online_return_policy.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_OnlineReturnPolicyService_GetOnlineReturnPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the return policy to retrieve. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {OnlineReturnPolicyServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new OnlineReturnPolicyServiceClient(); + + async function callGetOnlineReturnPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getOnlineReturnPolicy(request); + console.log(response); + } + + callGetOnlineReturnPolicy(); + // [END merchantapi_v1beta_generated_OnlineReturnPolicyService_GetOnlineReturnPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js new file mode 100644 index 00000000000..15bd92d118f --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js @@ -0,0 +1,82 @@ +// 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(parent) { + // [START merchantapi_v1beta_generated_OnlineReturnPolicyService_ListOnlineReturnPolicies_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 merchant account for which to list return policies. + * Format: `accounts/{account}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `OnlineReturnPolicy` resources to return. + * The service returns fewer than this value if the number of return policies + * for the given merchant is less that than the `pageSize`. The default value + * is 10. The maximum value is 100; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListOnlineReturnPolicies` + * call. Provide the page token to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListOnlineReturnPolicies` must match the call that provided the page + * token. The token returned as + * nextPageToken google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token + * in the response to the previous request. + */ + // const pageToken = 'abc123' + + // Imports the Accounts library + const {OnlineReturnPolicyServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new OnlineReturnPolicyServiceClient(); + + async function callListOnlineReturnPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = accountsClient.listOnlineReturnPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListOnlineReturnPolicies(); + // [END merchantapi_v1beta_generated_OnlineReturnPolicyService_ListOnlineReturnPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.disable_program.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.disable_program.js new file mode 100644 index 00000000000..ec1af5019c0 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.disable_program.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_ProgramsService_DisableProgram_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the program for which to disable participation for + * the given account. Format: `accounts/{account}/programs/{program}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {ProgramsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new ProgramsServiceClient(); + + async function callDisableProgram() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.disableProgram(request); + console.log(response); + } + + callDisableProgram(); + // [END merchantapi_v1beta_generated_ProgramsService_DisableProgram_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.enable_program.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.enable_program.js new file mode 100644 index 00000000000..0d8ac79b721 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.enable_program.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_ProgramsService_EnableProgram_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the program for which to enable participation for the + * given account. Format: `accounts/{account}/programs/{program}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {ProgramsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new ProgramsServiceClient(); + + async function callEnableProgram() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.enableProgram(request); + console.log(response); + } + + callEnableProgram(); + // [END merchantapi_v1beta_generated_ProgramsService_EnableProgram_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.get_program.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.get_program.js new file mode 100644 index 00000000000..9148cc32d12 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.get_program.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_ProgramsService_GetProgram_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the program to retrieve. + * Format: `accounts/{account}/programs/{program}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {ProgramsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new ProgramsServiceClient(); + + async function callGetProgram() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getProgram(request); + console.log(response); + } + + callGetProgram(); + // [END merchantapi_v1beta_generated_ProgramsService_GetProgram_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.list_programs.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.list_programs.js new file mode 100644 index 00000000000..8dc90d27f8d --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.list_programs.js @@ -0,0 +1,75 @@ +// 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(parent) { + // [START merchantapi_v1beta_generated_ProgramsService_ListPrograms_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the account for which to retrieve all programs. + * Format: `accounts/{account}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of programs to return in a single response. If + * unspecified (or 0), a default size of 1000 is used. The maximum value is + * 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A continuation token, received from a previous `ListPrograms` + * call. Provide this to retrieve the next page. + */ + // const pageToken = 'abc123' + + // Imports the Accounts library + const {ProgramsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new ProgramsServiceClient(); + + async function callListPrograms() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = accountsClient.listProgramsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPrograms(); + // [END merchantapi_v1beta_generated_ProgramsService_ListPrograms_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.create_region.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.create_region.js new file mode 100644 index 00000000000..78e0328ecec --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.create_region.js @@ -0,0 +1,73 @@ +// 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(parent, regionId, region) { + // [START merchantapi_v1beta_generated_RegionsService_CreateRegion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account to create a region for. + * Format: `accounts/{account}` + */ + // const parent = 'abc123' + /** + * Required. The identifier for the region, unique over all regions of the + * same account. + */ + // const regionId = 'abc123' + /** + * Required. The region to create. + */ + // const region = 'us-central1' + + // Imports the Accounts library + const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new RegionsServiceClient(); + + async function callCreateRegion() { + // Construct request + const request = { + parent, + regionId, + region, + }; + + // Run request + const response = await accountsClient.createRegion(request); + console.log(response); + } + + callCreateRegion(); + // [END merchantapi_v1beta_generated_RegionsService_CreateRegion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.delete_region.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.delete_region.js new file mode 100644 index 00000000000..96bb94e45a3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.delete_region.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_RegionsService_DeleteRegion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the region to delete. + * Format: `accounts/{account}/regions/{region}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new RegionsServiceClient(); + + async function callDeleteRegion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.deleteRegion(request); + console.log(response); + } + + callDeleteRegion(); + // [END merchantapi_v1beta_generated_RegionsService_DeleteRegion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.get_region.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.get_region.js new file mode 100644 index 00000000000..575804d174a --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.get_region.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_RegionsService_GetRegion_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the region to retrieve. + * Format: `accounts/{account}/regions/{region}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new RegionsServiceClient(); + + async function callGetRegion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getRegion(request); + console.log(response); + } + + callGetRegion(); + // [END merchantapi_v1beta_generated_RegionsService_GetRegion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.list_regions.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.list_regions.js new file mode 100644 index 00000000000..b34b2e08b3d --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.list_regions.js @@ -0,0 +1,78 @@ +// 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(parent) { + // [START merchantapi_v1beta_generated_RegionsService_ListRegions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account to list regions for. + * Format: `accounts/{account}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of regions to return. The service may return + * fewer than this value. + * If unspecified, at most 50 regions will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListRegions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListRegions` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Accounts library + const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new RegionsServiceClient(); + + async function callListRegions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = accountsClient.listRegionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRegions(); + // [END merchantapi_v1beta_generated_RegionsService_ListRegions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.update_region.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.update_region.js new file mode 100644 index 00000000000..992eb3150d5 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.update_region.js @@ -0,0 +1,67 @@ +// 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(region) { + // [START merchantapi_v1beta_generated_RegionsService_UpdateRegion_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 updated region. + */ + // const region = 'us-central1' + /** + * Optional. The comma-separated field mask indicating the fields to update. + * Example: + * `"displayName,postalCodeArea.regionCode"`. + */ + // const updateMask = {} + + // Imports the Accounts library + const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new RegionsServiceClient(); + + async function callUpdateRegion() { + // Construct request + const request = { + region, + }; + + // Run request + const response = await accountsClient.updateRegion(request); + console.log(response); + } + + callUpdateRegion(); + // [END merchantapi_v1beta_generated_RegionsService_UpdateRegion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.get_shipping_settings.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.get_shipping_settings.js new file mode 100644 index 00000000000..0f091840e21 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.get_shipping_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_ShippingSettingsService_GetShippingSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the shipping setting to retrieve. + * Format: `accounts/{account}/shippingsetting` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {ShippingSettingsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new ShippingSettingsServiceClient(); + + async function callGetShippingSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getShippingSettings(request); + console.log(response); + } + + callGetShippingSettings(); + // [END merchantapi_v1beta_generated_ShippingSettingsService_GetShippingSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.insert_shipping_settings.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.insert_shipping_settings.js new file mode 100644 index 00000000000..cf4ed038be3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.insert_shipping_settings.js @@ -0,0 +1,67 @@ +// 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(parent, shippingSetting) { + // [START merchantapi_v1beta_generated_ShippingSettingsService_InsertShippingSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account where this product will be inserted. + * Format: accounts/{account} + */ + // const parent = 'abc123' + /** + * Required. The new version of the account. + */ + // const shippingSetting = {} + + // Imports the Accounts library + const {ShippingSettingsServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new ShippingSettingsServiceClient(); + + async function callInsertShippingSettings() { + // Construct request + const request = { + parent, + shippingSetting, + }; + + // Run request + const response = await accountsClient.insertShippingSettings(request); + console.log(response); + } + + callInsertShippingSettings(); + // [END merchantapi_v1beta_generated_ShippingSettingsService_InsertShippingSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json new file mode 100644 index 00000000000..160fb967b63 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json @@ -0,0 +1,1967 @@ +{ + "clientLibrary": { + "name": "nodejs-accounts", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.shopping.merchant.accounts.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "merchantapi_v1beta_generated_AccountIssueService_ListAccountIssues_async", + "title": "AccountIssueService listAccountIssues Sample", + "origin": "API_DEFINITION", + "description": " Lists all account issues of a Merchant Center account.", + "canonical": true, + "file": "account_issue_service.list_account_issues.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAccountIssues", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountIssueService.ListAccountIssues", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "language_code", + "type": "TYPE_STRING" + }, + { + "name": "time_zone", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse", + "client": { + "shortName": "AccountIssueServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountIssueServiceClient" + }, + "method": { + "shortName": "ListAccountIssues", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountIssueService.ListAccountIssues", + "service": { + "shortName": "AccountIssueService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountIssueService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AccountsService_GetAccount_async", + "title": "AccountIssueService getAccount Sample", + "origin": "API_DEFINITION", + "description": " Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.", + "canonical": true, + "file": "accounts_service.get_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAccount", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.GetAccount", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Account", + "client": { + "shortName": "AccountsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" + }, + "method": { + "shortName": "GetAccount", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.GetAccount", + "service": { + "shortName": "AccountsService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_async", + "title": "AccountIssueService createAndConfigureAccount Sample", + "origin": "API_DEFINITION", + "description": " Creates a standalone Merchant Center account with additional configuration. Adds the user that makes the request as an admin for the new account.", + "canonical": true, + "file": "accounts_service.create_and_configure_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAndConfigureAccount", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.CreateAndConfigureAccount", + "async": true, + "parameters": [ + { + "name": "account", + "type": ".google.shopping.merchant.accounts.v1beta.Account" + }, + { + "name": "users", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "accept_terms_of_service", + "type": ".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService" + }, + { + "name": "service", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Account", + "client": { + "shortName": "AccountsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" + }, + "method": { + "shortName": "CreateAndConfigureAccount", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.CreateAndConfigureAccount", + "service": { + "shortName": "AccountsService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AccountsService_DeleteAccount_async", + "title": "AccountIssueService deleteAccount Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified account regardless of its type: standalone, MCA or sub-account. Deleting an MCA leads to the deletion of all of its sub-accounts. Executing this method requires admin access.", + "canonical": true, + "file": "accounts_service.delete_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAccount", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.DeleteAccount", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AccountsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" + }, + "method": { + "shortName": "DeleteAccount", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.DeleteAccount", + "service": { + "shortName": "AccountsService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AccountsService_UpdateAccount_async", + "title": "AccountIssueService updateAccount Sample", + "origin": "API_DEFINITION", + "description": " Updates an account regardless of its type: standalone, MCA or sub-account. Executing this method requires admin access.", + "canonical": true, + "file": "accounts_service.update_account.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAccount", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.UpdateAccount", + "async": true, + "parameters": [ + { + "name": "account", + "type": ".google.shopping.merchant.accounts.v1beta.Account" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Account", + "client": { + "shortName": "AccountsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" + }, + "method": { + "shortName": "UpdateAccount", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.UpdateAccount", + "service": { + "shortName": "AccountsService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AccountsService_ListAccounts_async", + "title": "AccountIssueService listAccounts Sample", + "origin": "API_DEFINITION", + "description": " Lists accounts accessible to the calling user and matching the constraints of the request such as page size or filters. This is not just listing the sub-accounts of an MCA, but all accounts the calling user has access to including other MCAs, linked accounts, standalone accounts and so on.", + "canonical": true, + "file": "accounts_service.list_accounts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAccounts", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.ListAccounts", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ListAccountsResponse", + "client": { + "shortName": "AccountsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" + }, + "method": { + "shortName": "ListAccounts", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.ListAccounts", + "service": { + "shortName": "AccountsService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AccountsService_ListSubAccounts_async", + "title": "AccountIssueService listSubAccounts Sample", + "origin": "API_DEFINITION", + "description": " List all sub-accounts for a given multi client account. This is a convenience wrapper for the more powerful `ListAccounts` method. This method will produce the same results as calling `ListsAccounts` with the following filter: `relationship(providerId={parent} AND service(type=\"ACCOUNT_AGGREGATION\"))`", + "canonical": true, + "file": "accounts_service.list_sub_accounts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSubAccounts", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.ListSubAccounts", + "async": true, + "parameters": [ + { + "name": "provider", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse", + "client": { + "shortName": "AccountsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" + }, + "method": { + "shortName": "ListSubAccounts", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.ListSubAccounts", + "service": { + "shortName": "AccountsService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AccountTaxService_GetAccountTax_async", + "title": "AccountIssueService getAccountTax Sample", + "origin": "API_DEFINITION", + "description": " Returns the tax rules that match the conditions of GetAccountTaxRequest", + "canonical": true, + "file": "account_tax_service.get_account_tax.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAccountTax", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.GetAccountTax", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.AccountTax", + "client": { + "shortName": "AccountTaxServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxServiceClient" + }, + "method": { + "shortName": "GetAccountTax", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.GetAccountTax", + "service": { + "shortName": "AccountTaxService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AccountTaxService_ListAccountTax_async", + "title": "AccountIssueService listAccountTax Sample", + "origin": "API_DEFINITION", + "description": " Lists the tax settings of the sub-accounts only in your Merchant Center account. This method can only be called on a multi-client account, otherwise it'll return an error.", + "canonical": true, + "file": "account_tax_service.list_account_tax.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAccountTax", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.ListAccountTax", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse", + "client": { + "shortName": "AccountTaxServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxServiceClient" + }, + "method": { + "shortName": "ListAccountTax", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.ListAccountTax", + "service": { + "shortName": "AccountTaxService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_AccountTaxService_UpdateAccountTax_async", + "title": "AccountIssueService updateAccountTax Sample", + "origin": "API_DEFINITION", + "description": " Updates the tax settings of the account.", + "canonical": true, + "file": "account_tax_service.update_account_tax.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAccountTax", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.UpdateAccountTax", + "async": true, + "parameters": [ + { + "name": "account_tax", + "type": ".google.shopping.merchant.accounts.v1beta.AccountTax" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.AccountTax", + "client": { + "shortName": "AccountTaxServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxServiceClient" + }, + "method": { + "shortName": "UpdateAccountTax", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.UpdateAccountTax", + "service": { + "shortName": "AccountTaxService", + "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService" + } + } + } + }, + { + "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", + "origin": "API_DEFINITION", + "description": " Retrieves the business identity of an account.", + "canonical": true, + "file": "business_identity_service.get_business_identity.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBusinessIdentity", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService.GetBusinessIdentity", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.BusinessIdentity", + "client": { + "shortName": "BusinessIdentityServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityServiceClient" + }, + "method": { + "shortName": "GetBusinessIdentity", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService.GetBusinessIdentity", + "service": { + "shortName": "BusinessIdentityService", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_BusinessIdentityService_UpdateBusinessIdentity_async", + "title": "AccountIssueService updateBusinessIdentity Sample", + "origin": "API_DEFINITION", + "description": " Updates the business identity of an account. Executing this method requires admin access.", + "canonical": true, + "file": "business_identity_service.update_business_identity.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBusinessIdentity", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService.UpdateBusinessIdentity", + "async": true, + "parameters": [ + { + "name": "business_identity", + "type": ".google.shopping.merchant.accounts.v1beta.BusinessIdentity" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.BusinessIdentity", + "client": { + "shortName": "BusinessIdentityServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityServiceClient" + }, + "method": { + "shortName": "UpdateBusinessIdentity", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService.UpdateBusinessIdentity", + "service": { + "shortName": "BusinessIdentityService", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_BusinessInfoService_GetBusinessInfo_async", + "title": "AccountIssueService getBusinessInfo Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the business info of an account.", + "canonical": true, + "file": "business_info_service.get_business_info.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBusinessInfo", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService.GetBusinessInfo", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.BusinessInfo", + "client": { + "shortName": "BusinessInfoServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoServiceClient" + }, + "method": { + "shortName": "GetBusinessInfo", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService.GetBusinessInfo", + "service": { + "shortName": "BusinessInfoService", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_BusinessInfoService_UpdateBusinessInfo_async", + "title": "AccountIssueService updateBusinessInfo Sample", + "origin": "API_DEFINITION", + "description": " Updates the business info of an account. Executing this method requires admin access.", + "canonical": true, + "file": "business_info_service.update_business_info.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBusinessInfo", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService.UpdateBusinessInfo", + "async": true, + "parameters": [ + { + "name": "business_info", + "type": ".google.shopping.merchant.accounts.v1beta.BusinessInfo" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.BusinessInfo", + "client": { + "shortName": "BusinessInfoServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoServiceClient" + }, + "method": { + "shortName": "UpdateBusinessInfo", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService.UpdateBusinessInfo", + "service": { + "shortName": "BusinessInfoService", + "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_EmailPreferencesService_GetEmailPreferences_async", + "title": "AccountIssueService getEmailPreferences Sample", + "origin": "API_DEFINITION", + "description": " Returns the email preferences for a Merchant Center account user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.", + "canonical": true, + "file": "email_preferences_service.get_email_preferences.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEmailPreferences", + "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService.GetEmailPreferences", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.EmailPreferences", + "client": { + "shortName": "EmailPreferencesServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesServiceClient" + }, + "method": { + "shortName": "GetEmailPreferences", + "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService.GetEmailPreferences", + "service": { + "shortName": "EmailPreferencesService", + "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_EmailPreferencesService_UpdateEmailPreferences_async", + "title": "AccountIssueService updateEmailPreferences Sample", + "origin": "API_DEFINITION", + "description": " Updates the email preferences for a Merchant Center account user. MCA users should specify the MCA account rather than a sub-account of the MCA. Preferences which are not explicitly selected in the update mask will not be updated. It is invalid for updates to specify an UNCONFIRMED opt-in status value. Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.", + "canonical": true, + "file": "email_preferences_service.update_email_preferences.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEmailPreferences", + "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService.UpdateEmailPreferences", + "async": true, + "parameters": [ + { + "name": "email_preferences", + "type": ".google.shopping.merchant.accounts.v1beta.EmailPreferences" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.EmailPreferences", + "client": { + "shortName": "EmailPreferencesServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesServiceClient" + }, + "method": { + "shortName": "UpdateEmailPreferences", + "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService.UpdateEmailPreferences", + "service": { + "shortName": "EmailPreferencesService", + "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_HomepageService_GetHomepage_async", + "title": "AccountIssueService getHomepage Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a store's homepage.", + "canonical": true, + "file": "homepage_service.get_homepage.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetHomepage", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.GetHomepage", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Homepage", + "client": { + "shortName": "HomepageServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageServiceClient" + }, + "method": { + "shortName": "GetHomepage", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.GetHomepage", + "service": { + "shortName": "HomepageService", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_HomepageService_UpdateHomepage_async", + "title": "AccountIssueService updateHomepage Sample", + "origin": "API_DEFINITION", + "description": " Updates a store's homepage. Executing this method requires admin access.", + "canonical": true, + "file": "homepage_service.update_homepage.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateHomepage", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.UpdateHomepage", + "async": true, + "parameters": [ + { + "name": "homepage", + "type": ".google.shopping.merchant.accounts.v1beta.Homepage" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Homepage", + "client": { + "shortName": "HomepageServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageServiceClient" + }, + "method": { + "shortName": "UpdateHomepage", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.UpdateHomepage", + "service": { + "shortName": "HomepageService", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_HomepageService_ClaimHomepage_async", + "title": "AccountIssueService claimHomepage Sample", + "origin": "API_DEFINITION", + "description": " Claims a store's homepage. Executing this method requires admin access. If the homepage is already claimed, this will recheck the verification (unless the merchant is exempted from claiming, which also exempts from verification) and return a successful response. If ownership can no longer be verified, it will return an error, but it won't clear the claim. In case of failure, a canonical error message will be returned: * PERMISSION_DENIED: user doesn't have the necessary permissions on this MC account; * FAILED_PRECONDITION: - The account is not a Merchant Center account; - MC account doesn't have a homepage; - claiming failed (in this case the error message will contain more details).", + "canonical": true, + "file": "homepage_service.claim_homepage.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ClaimHomepage", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.ClaimHomepage", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Homepage", + "client": { + "shortName": "HomepageServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageServiceClient" + }, + "method": { + "shortName": "ClaimHomepage", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.ClaimHomepage", + "service": { + "shortName": "HomepageService", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_HomepageService_UnclaimHomepage_async", + "title": "AccountIssueService unclaimHomepage Sample", + "origin": "API_DEFINITION", + "description": " Unclaims a store's homepage. Executing this method requires admin access.", + "canonical": true, + "file": "homepage_service.unclaim_homepage.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UnclaimHomepage", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.UnclaimHomepage", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Homepage", + "client": { + "shortName": "HomepageServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageServiceClient" + }, + "method": { + "shortName": "UnclaimHomepage", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.UnclaimHomepage", + "service": { + "shortName": "HomepageService", + "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_OnlineReturnPolicyService_GetOnlineReturnPolicy_async", + "title": "AccountIssueService getOnlineReturnPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets an existing return policy.", + "canonical": true, + "file": "online_return_policy_service.get_online_return_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetOnlineReturnPolicy", + "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.GetOnlineReturnPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy", + "client": { + "shortName": "OnlineReturnPolicyServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyServiceClient" + }, + "method": { + "shortName": "GetOnlineReturnPolicy", + "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.GetOnlineReturnPolicy", + "service": { + "shortName": "OnlineReturnPolicyService", + "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_OnlineReturnPolicyService_ListOnlineReturnPolicies_async", + "title": "AccountIssueService listOnlineReturnPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists all existing return policies.", + "canonical": true, + "file": "online_return_policy_service.list_online_return_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListOnlineReturnPolicies", + "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.ListOnlineReturnPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse", + "client": { + "shortName": "OnlineReturnPolicyServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyServiceClient" + }, + "method": { + "shortName": "ListOnlineReturnPolicies", + "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.ListOnlineReturnPolicies", + "service": { + "shortName": "OnlineReturnPolicyService", + "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_ProgramsService_GetProgram_async", + "title": "AccountIssueService getProgram Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the specified program for the account.", + "canonical": true, + "file": "programs_service.get_program.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProgram", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.GetProgram", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Program", + "client": { + "shortName": "ProgramsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsServiceClient" + }, + "method": { + "shortName": "GetProgram", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.GetProgram", + "service": { + "shortName": "ProgramsService", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_ProgramsService_ListPrograms_async", + "title": "AccountIssueService listPrograms Sample", + "origin": "API_DEFINITION", + "description": " Retrieves all programs for the account.", + "canonical": true, + "file": "programs_service.list_programs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPrograms", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.ListPrograms", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ListProgramsResponse", + "client": { + "shortName": "ProgramsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsServiceClient" + }, + "method": { + "shortName": "ListPrograms", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.ListPrograms", + "service": { + "shortName": "ProgramsService", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_ProgramsService_EnableProgram_async", + "title": "AccountIssueService enableProgram Sample", + "origin": "API_DEFINITION", + "description": " Enable participation in the specified program for the account. Executing this method requires admin access.", + "canonical": true, + "file": "programs_service.enable_program.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnableProgram", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.EnableProgram", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Program", + "client": { + "shortName": "ProgramsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsServiceClient" + }, + "method": { + "shortName": "EnableProgram", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.EnableProgram", + "service": { + "shortName": "ProgramsService", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_ProgramsService_DisableProgram_async", + "title": "AccountIssueService disableProgram Sample", + "origin": "API_DEFINITION", + "description": " Disable participation in the specified program for the account. Executing this method requires admin access.", + "canonical": true, + "file": "programs_service.disable_program.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisableProgram", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.DisableProgram", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Program", + "client": { + "shortName": "ProgramsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsServiceClient" + }, + "method": { + "shortName": "DisableProgram", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.DisableProgram", + "service": { + "shortName": "ProgramsService", + "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_RegionsService_GetRegion_async", + "title": "AccountIssueService getRegion Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a region defined in your Merchant Center account.", + "canonical": true, + "file": "regions_service.get_region.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRegion", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.GetRegion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Region", + "client": { + "shortName": "RegionsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" + }, + "method": { + "shortName": "GetRegion", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.GetRegion", + "service": { + "shortName": "RegionsService", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_RegionsService_CreateRegion_async", + "title": "AccountIssueService createRegion Sample", + "origin": "API_DEFINITION", + "description": " Creates a region definition in your Merchant Center account. Executing this method requires admin access.", + "canonical": true, + "file": "regions_service.create_region.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRegion", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.CreateRegion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "region_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": ".google.shopping.merchant.accounts.v1beta.Region" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Region", + "client": { + "shortName": "RegionsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" + }, + "method": { + "shortName": "CreateRegion", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.CreateRegion", + "service": { + "shortName": "RegionsService", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_RegionsService_UpdateRegion_async", + "title": "AccountIssueService updateRegion Sample", + "origin": "API_DEFINITION", + "description": " Updates a region definition in your Merchant Center account. Executing this method requires admin access.", + "canonical": true, + "file": "regions_service.update_region.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRegion", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.UpdateRegion", + "async": true, + "parameters": [ + { + "name": "region", + "type": ".google.shopping.merchant.accounts.v1beta.Region" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.Region", + "client": { + "shortName": "RegionsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" + }, + "method": { + "shortName": "UpdateRegion", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.UpdateRegion", + "service": { + "shortName": "RegionsService", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_RegionsService_DeleteRegion_async", + "title": "AccountIssueService deleteRegion Sample", + "origin": "API_DEFINITION", + "description": " Deletes a region definition from your Merchant Center account. Executing this method requires admin access.", + "canonical": true, + "file": "regions_service.delete_region.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRegion", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.DeleteRegion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegionsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" + }, + "method": { + "shortName": "DeleteRegion", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.DeleteRegion", + "service": { + "shortName": "RegionsService", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_RegionsService_ListRegions_async", + "title": "AccountIssueService listRegions Sample", + "origin": "API_DEFINITION", + "description": " Lists the regions in your Merchant Center account.", + "canonical": true, + "file": "regions_service.list_regions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRegions", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.ListRegions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ListRegionsResponse", + "client": { + "shortName": "RegionsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" + }, + "method": { + "shortName": "ListRegions", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.ListRegions", + "service": { + "shortName": "RegionsService", + "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_ShippingSettingsService_GetShippingSettings_async", + "title": "AccountIssueService getShippingSettings Sample", + "origin": "API_DEFINITION", + "description": " Retrieve shipping setting information.", + "canonical": true, + "file": "shipping_settings_service.get_shipping_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetShippingSettings", + "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService.GetShippingSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ShippingSettings", + "client": { + "shortName": "ShippingSettingsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsServiceClient" + }, + "method": { + "shortName": "GetShippingSettings", + "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService.GetShippingSettings", + "service": { + "shortName": "ShippingSettingsService", + "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_ShippingSettingsService_InsertShippingSettings_async", + "title": "AccountIssueService insertShippingSettings Sample", + "origin": "API_DEFINITION", + "description": " Replace the shipping setting of a merchant with the request shipping setting. Executing this method requires admin access.", + "canonical": true, + "file": "shipping_settings_service.insert_shipping_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InsertShippingSettings", + "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService.InsertShippingSettings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "shipping_setting", + "type": ".google.shopping.merchant.accounts.v1beta.ShippingSettings" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ShippingSettings", + "client": { + "shortName": "ShippingSettingsServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsServiceClient" + }, + "method": { + "shortName": "InsertShippingSettings", + "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService.InsertShippingSettings", + "service": { + "shortName": "ShippingSettingsService", + "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_GetTermsOfServiceAgreementState_async", + "title": "AccountIssueService getTermsOfServiceAgreementState Sample", + "origin": "API_DEFINITION", + "description": " Returns the state of a terms of service agreement.", + "canonical": true, + "file": "terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTermsOfServiceAgreementState", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.GetTermsOfServiceAgreementState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState", + "client": { + "shortName": "TermsOfServiceAgreementStateServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateServiceClient" + }, + "method": { + "shortName": "GetTermsOfServiceAgreementState", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.GetTermsOfServiceAgreementState", + "service": { + "shortName": "TermsOfServiceAgreementStateService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_RetrieveForApplicationTermsOfServiceAgreementState_async", + "title": "AccountIssueService retrieveForApplicationTermsOfServiceAgreementState Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the state of the agreement for the application terms of service.", + "canonical": true, + "file": "terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetrieveForApplicationTermsOfServiceAgreementState", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.RetrieveForApplicationTermsOfServiceAgreementState", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState", + "client": { + "shortName": "TermsOfServiceAgreementStateServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateServiceClient" + }, + "method": { + "shortName": "RetrieveForApplicationTermsOfServiceAgreementState", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.RetrieveForApplicationTermsOfServiceAgreementState", + "service": { + "shortName": "TermsOfServiceAgreementStateService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_TermsOfServiceService_GetTermsOfService_async", + "title": "AccountIssueService getTermsOfService Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the `TermsOfService` associated with the provided version.", + "canonical": true, + "file": "terms_of_service_service.get_terms_of_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTermsOfService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.GetTermsOfService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.TermsOfService", + "client": { + "shortName": "TermsOfServiceServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceServiceClient" + }, + "method": { + "shortName": "GetTermsOfService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.GetTermsOfService", + "service": { + "shortName": "TermsOfServiceService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_async", + "title": "AccountIssueService retrieveLatestTermsOfService Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the latest version of the `TermsOfService` for a given `kind` and `region_code`.", + "canonical": true, + "file": "terms_of_service_service.retrieve_latest_terms_of_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetrieveLatestTermsOfService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.RetrieveLatestTermsOfService", + "async": true, + "parameters": [ + { + "name": "region_code", + "type": "TYPE_STRING" + }, + { + "name": "kind", + "type": ".google.shopping.merchant.accounts.v1beta.TermsOfServiceKind" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.TermsOfService", + "client": { + "shortName": "TermsOfServiceServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceServiceClient" + }, + "method": { + "shortName": "RetrieveLatestTermsOfService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.RetrieveLatestTermsOfService", + "service": { + "shortName": "TermsOfServiceService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_TermsOfServiceService_AcceptTermsOfService_async", + "title": "AccountIssueService acceptTermsOfService Sample", + "origin": "API_DEFINITION", + "description": " Accepts a `TermsOfService`. Executing this method requires admin access.", + "canonical": true, + "file": "terms_of_service_service.accept_terms_of_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AcceptTermsOfService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.AcceptTermsOfService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "account", + "type": "TYPE_STRING" + }, + { + "name": "region_code", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "TermsOfServiceServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceServiceClient" + }, + "method": { + "shortName": "AcceptTermsOfService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.AcceptTermsOfService", + "service": { + "shortName": "TermsOfServiceService", + "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_UserService_GetUser_async", + "title": "AccountIssueService getUser Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a Merchant Center account user.", + "canonical": true, + "file": "user_service.get_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUser", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.GetUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.User", + "client": { + "shortName": "UserServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" + }, + "method": { + "shortName": "GetUser", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.GetUser", + "service": { + "shortName": "UserService", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_UserService_CreateUser_async", + "title": "AccountIssueService createUser Sample", + "origin": "API_DEFINITION", + "description": " Creates a Merchant Center account user. Executing this method requires admin access.", + "canonical": true, + "file": "user_service.create_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUser", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.CreateUser", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "user_id", + "type": "TYPE_STRING" + }, + { + "name": "user", + "type": ".google.shopping.merchant.accounts.v1beta.User" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.User", + "client": { + "shortName": "UserServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" + }, + "method": { + "shortName": "CreateUser", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.CreateUser", + "service": { + "shortName": "UserService", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_UserService_DeleteUser_async", + "title": "AccountIssueService deleteUser Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Merchant Center account user. Executing this method requires admin access.", + "canonical": true, + "file": "user_service.delete_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUser", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.DeleteUser", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "UserServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" + }, + "method": { + "shortName": "DeleteUser", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.DeleteUser", + "service": { + "shortName": "UserService", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_UserService_UpdateUser_async", + "title": "AccountIssueService updateUser Sample", + "origin": "API_DEFINITION", + "description": " Updates a Merchant Center account user. Executing this method requires admin access.", + "canonical": true, + "file": "user_service.update_user.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUser", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.UpdateUser", + "async": true, + "parameters": [ + { + "name": "user", + "type": ".google.shopping.merchant.accounts.v1beta.User" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.User", + "client": { + "shortName": "UserServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" + }, + "method": { + "shortName": "UpdateUser", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.UpdateUser", + "service": { + "shortName": "UserService", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService" + } + } + } + }, + { + "regionTag": "merchantapi_v1beta_generated_UserService_ListUsers_async", + "title": "AccountIssueService listUsers Sample", + "origin": "API_DEFINITION", + "description": " Lists all users of a Merchant Center account.", + "canonical": true, + "file": "user_service.list_users.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsers", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.ListUsers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.shopping.merchant.accounts.v1beta.ListUsersResponse", + "client": { + "shortName": "UserServiceClient", + "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" + }, + "method": { + "shortName": "ListUsers", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService.ListUsers", + "service": { + "shortName": "UserService", + "fullName": "google.shopping.merchant.accounts.v1beta.UserService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js new file mode 100644 index 00000000000..6a61dbac5ec --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js @@ -0,0 +1,63 @@ +// 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_TermsOfServiceAgreementStateService_GetTermsOfServiceAgreementState_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 terms of service version. + * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` + * The identifier format is: `{TermsOfServiceKind}-{country}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {TermsOfServiceAgreementStateServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new TermsOfServiceAgreementStateServiceClient(); + + async function callGetTermsOfServiceAgreementState() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getTermsOfServiceAgreementState(request); + console.log(response); + } + + callGetTermsOfServiceAgreementState(); + // [END merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_GetTermsOfServiceAgreementState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js new file mode 100644 index 00000000000..c3cf9b1f147 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.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(parent) { + // [START merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_RetrieveForApplicationTermsOfServiceAgreementState_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The account for which to get a TermsOfServiceAgreementState + * Format: `accounts/{account}` + */ + // const parent = 'abc123' + + // Imports the Accounts library + const {TermsOfServiceAgreementStateServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new TermsOfServiceAgreementStateServiceClient(); + + async function callRetrieveForApplicationTermsOfServiceAgreementState() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await accountsClient.retrieveForApplicationTermsOfServiceAgreementState(request); + console.log(response); + } + + callRetrieveForApplicationTermsOfServiceAgreementState(); + // [END merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_RetrieveForApplicationTermsOfServiceAgreementState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js new file mode 100644 index 00000000000..0184b6cc553 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js @@ -0,0 +1,74 @@ +// 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, account, regionCode) { + // [START merchantapi_v1beta_generated_TermsOfServiceService_AcceptTermsOfService_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 terms of service version. + * Format: `termsOfService/{version}` + */ + // const name = 'abc123' + /** + * Required. The account for which to accept the ToS. + */ + // const account = 'abc123' + /** + * 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' + + // Imports the Accounts library + const {TermsOfServiceServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new TermsOfServiceServiceClient(); + + async function callAcceptTermsOfService() { + // Construct request + const request = { + name, + account, + regionCode, + }; + + // Run request + const response = await accountsClient.acceptTermsOfService(request); + console.log(response); + } + + callAcceptTermsOfService(); + // [END merchantapi_v1beta_generated_TermsOfServiceService_AcceptTermsOfService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.get_terms_of_service.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.get_terms_of_service.js new file mode 100644 index 00000000000..3984f47f00f --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.get_terms_of_service.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_TermsOfServiceService_GetTermsOfService_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 terms of service version. + * Format: `termsOfService/{version}` + */ + // const name = 'abc123' + + // Imports the Accounts library + const {TermsOfServiceServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new TermsOfServiceServiceClient(); + + async function callGetTermsOfService() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getTermsOfService(request); + console.log(response); + } + + callGetTermsOfService(); + // [END merchantapi_v1beta_generated_TermsOfServiceService_GetTermsOfService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js new file mode 100644 index 00000000000..b7ad2cd0eb2 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js @@ -0,0 +1,68 @@ +// 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(regionCode, kind) { + // [START merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_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. 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' + /** + * Required. The Kind this terms of service version applies to. + */ + // const kind = {} + + // Imports the Accounts library + const {TermsOfServiceServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new TermsOfServiceServiceClient(); + + async function callRetrieveLatestTermsOfService() { + // Construct request + const request = { + regionCode, + kind, + }; + + // Run request + const response = await accountsClient.retrieveLatestTermsOfService(request); + console.log(response); + } + + callRetrieveLatestTermsOfService(); + // [END merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.create_user.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.create_user.js new file mode 100644 index 00000000000..43b6ed175f1 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.create_user.js @@ -0,0 +1,73 @@ +// 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(parent, userId, user) { + // [START merchantapi_v1beta_generated_UserService_CreateUser_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 account for which a user will be + * created. Format: `accounts/{account}` + */ + // const parent = 'abc123' + /** + * Required. The email address of the user (for example, + * `john.doe@gmail.com`). + */ + // const userId = 'abc123' + /** + * Required. The user to create. + */ + // const user = {} + + // Imports the Accounts library + const {UserServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new UserServiceClient(); + + async function callCreateUser() { + // Construct request + const request = { + parent, + userId, + user, + }; + + // Run request + const response = await accountsClient.createUser(request); + console.log(response); + } + + callCreateUser(); + // [END merchantapi_v1beta_generated_UserService_CreateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.delete_user.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.delete_user.js new file mode 100644 index 00000000000..62b5922a212 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.delete_user.js @@ -0,0 +1,64 @@ +// 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_UserService_DeleteUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the user to delete. + * Format: `accounts/{account}/users/{email}` + * It is also possible to delete the user corresponding to the caller by using + * `me` rather than an email address as in `accounts/{account}/users/me`. + */ + // const name = 'abc123' + + // Imports the Accounts library + const {UserServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new UserServiceClient(); + + async function callDeleteUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.deleteUser(request); + console.log(response); + } + + callDeleteUser(); + // [END merchantapi_v1beta_generated_UserService_DeleteUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.get_user.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.get_user.js new file mode 100644 index 00000000000..8ae9ba97ce7 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.get_user.js @@ -0,0 +1,65 @@ +// 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_UserService_GetUser_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the user to retrieve. + * Format: `accounts/{account}/users/{email}` + * It is also possible to retrieve the user corresponding to the caller by + * using `me` rather than an email address as in + * `accounts/{account}/users/me`. + */ + // const name = 'abc123' + + // Imports the Accounts library + const {UserServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new UserServiceClient(); + + async function callGetUser() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await accountsClient.getUser(request); + console.log(response); + } + + callGetUser(); + // [END merchantapi_v1beta_generated_UserService_GetUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.list_users.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.list_users.js new file mode 100644 index 00000000000..f47703e3006 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.list_users.js @@ -0,0 +1,77 @@ +// 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(parent) { + // [START merchantapi_v1beta_generated_UserService_ListUsers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of users. + * Format: `accounts/{account}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of users to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListUsers` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListUsers` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Accounts library + const {UserServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new UserServiceClient(); + + async function callListUsers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = accountsClient.listUsersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsers(); + // [END merchantapi_v1beta_generated_UserService_ListUsers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.update_user.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.update_user.js new file mode 100644 index 00000000000..cbd950921ef --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.update_user.js @@ -0,0 +1,68 @@ +// 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(user, updateMask) { + // [START merchantapi_v1beta_generated_UserService_UpdateUser_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 user. + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + */ + // const user = {} + /** + * Required. List of fields being updated. + */ + // const updateMask = {} + + // Imports the Accounts library + const {UserServiceClient} = require('@google-shopping/accounts').v1beta; + + // Instantiates a client + const accountsClient = new UserServiceClient(); + + async function callUpdateUser() { + // Construct request + const request = { + user, + updateMask, + }; + + // Run request + const response = await accountsClient.updateUser(request); + console.log(response); + } + + callUpdateUser(); + // [END merchantapi_v1beta_generated_UserService_UpdateUser_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/index.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/index.ts new file mode 100644 index 00000000000..48b246a3834 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/index.ts @@ -0,0 +1,53 @@ +// 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 v1beta from './v1beta'; +const AccountIssueServiceClient = v1beta.AccountIssueServiceClient; +type AccountIssueServiceClient = v1beta.AccountIssueServiceClient; +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; +type BusinessInfoServiceClient = v1beta.BusinessInfoServiceClient; +const EmailPreferencesServiceClient = v1beta.EmailPreferencesServiceClient; +type EmailPreferencesServiceClient = v1beta.EmailPreferencesServiceClient; +const HomepageServiceClient = v1beta.HomepageServiceClient; +type HomepageServiceClient = v1beta.HomepageServiceClient; +const OnlineReturnPolicyServiceClient = v1beta.OnlineReturnPolicyServiceClient; +type OnlineReturnPolicyServiceClient = v1beta.OnlineReturnPolicyServiceClient; +const ProgramsServiceClient = v1beta.ProgramsServiceClient; +type ProgramsServiceClient = v1beta.ProgramsServiceClient; +const RegionsServiceClient = v1beta.RegionsServiceClient; +type RegionsServiceClient = v1beta.RegionsServiceClient; +const ShippingSettingsServiceClient = v1beta.ShippingSettingsServiceClient; +type ShippingSettingsServiceClient = v1beta.ShippingSettingsServiceClient; +const TermsOfServiceAgreementStateServiceClient = v1beta.TermsOfServiceAgreementStateServiceClient; +type TermsOfServiceAgreementStateServiceClient = v1beta.TermsOfServiceAgreementStateServiceClient; +const TermsOfServiceServiceClient = v1beta.TermsOfServiceServiceClient; +type TermsOfServiceServiceClient = v1beta.TermsOfServiceServiceClient; +const UserServiceClient = v1beta.UserServiceClient; +type UserServiceClient = v1beta.UserServiceClient; +export {v1beta, AccountIssueServiceClient, AccountsServiceClient, AccountTaxServiceClient, AutofeedSettingsServiceClient, BusinessIdentityServiceClient, BusinessInfoServiceClient, EmailPreferencesServiceClient, HomepageServiceClient, OnlineReturnPolicyServiceClient, ProgramsServiceClient, RegionsServiceClient, ShippingSettingsServiceClient, TermsOfServiceAgreementStateServiceClient, TermsOfServiceServiceClient, UserServiceClient}; +export default {v1beta, AccountIssueServiceClient, AccountsServiceClient, AccountTaxServiceClient, AutofeedSettingsServiceClient, BusinessIdentityServiceClient, BusinessInfoServiceClient, EmailPreferencesServiceClient, HomepageServiceClient, OnlineReturnPolicyServiceClient, ProgramsServiceClient, RegionsServiceClient, ShippingSettingsServiceClient, TermsOfServiceAgreementStateServiceClient, TermsOfServiceServiceClient, UserServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client.ts new file mode 100644 index 00000000000..2d4ace6d15e --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client.ts @@ -0,0 +1,1065 @@ +// 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, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/account_issue_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './account_issue_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support `AccountIssueService` API. + * @class + * @memberof v1beta + */ +export class AccountIssueServiceClient { + 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}; + accountIssueServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AccountIssueServiceClient. + * + * @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 AccountIssueServiceClient({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 AccountIssueServiceClient; + 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}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAccountIssues: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accountIssues') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.shopping.merchant.accounts.v1beta.AccountIssueService', 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.accountIssueServiceStub) { + return this.accountIssueServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.AccountIssueService. + this.accountIssueServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.AccountIssueService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.AccountIssueService, + 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 accountIssueServiceStubMethods = + ['listAccountIssues']; + for (const methodName of accountIssueServiceStubMethods) { + const callPromise = this.accountIssueServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.accountIssueServiceStub; + } + + /** + * 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 -- + // ------------------- + + /** + * Lists all account issues of a Merchant Center account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of issues. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of issues to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAccountIssues` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAccountIssues` must + * match the call that provided the page token. + * @param {string} [request.languageCode] + * Optional. The issues in the response will have human-readable fields in the + * 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 {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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.AccountIssue|AccountIssue}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAccountIssuesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAccountIssues( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[], + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse + ]>; + listAccountIssues( + request: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccountIssue>): void; + listAccountIssues( + request: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccountIssue>): void; + listAccountIssues( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccountIssue>, + callback?: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccountIssue>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[], + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAccountIssues(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of issues. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of issues to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAccountIssues` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAccountIssues` must + * match the call that provided the page token. + * @param {string} [request.languageCode] + * Optional. The issues in the response will have human-readable fields in the + * 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 {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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.AccountIssue|AccountIssue} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAccountIssuesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAccountIssuesStream( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAccountIssues']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccountIssues.createStream( + this.innerApiCalls.listAccountIssues as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAccountIssues`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of issues. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of issues to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAccountIssues` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAccountIssues` must + * match the call that provided the page token. + * @param {string} [request.languageCode] + * Optional. The issues in the response will have human-readable fields in the + * 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 {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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.shopping.merchant.accounts.v1beta.AccountIssue|AccountIssue}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/account_issue_service.list_account_issues.js + * region_tag:merchantapi_v1beta_generated_AccountIssueService_ListAccountIssues_async + */ + listAccountIssuesAsync( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAccountIssues']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccountIssues.asyncIterate( + this.innerApiCalls['listAccountIssues'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- 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.accountIssueServiceStub && !this._terminated) { + return this.accountIssueServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client_config.json new file mode 100644 index 00000000000..3c6eab21940 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.AccountIssueService": { + "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": { + "ListAccountIssues": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client.ts new file mode 100644 index 00000000000..ef5db4fa63e --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client.ts @@ -0,0 +1,1172 @@ +// 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, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/account_tax_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './account_tax_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages account level tax setting data. + * + * This API defines the following resource model: + * + * - {@link protos.google.shopping.merchant.accounts.v1main.AccountTax|AccountTax} + * @class + * @memberof v1beta + */ +export class AccountTaxServiceClient { + 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}; + accountTaxServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AccountTaxServiceClient. + * + * @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 AccountTaxServiceClient({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 AccountTaxServiceClient; + 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}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAccountTax: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accountTaxes') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.shopping.merchant.accounts.v1beta.AccountTaxService', 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.accountTaxServiceStub) { + return this.accountTaxServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.AccountTaxService. + this.accountTaxServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.AccountTaxService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.AccountTaxService, + 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 accountTaxServiceStubMethods = + ['getAccountTax', 'listAccountTax', 'updateAccountTax']; + for (const methodName of accountTaxServiceStubMethods) { + const callPromise = this.accountTaxServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.accountTaxServiceStub; + } + + /** + * 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 -- + // ------------------- +/** + * Returns the tax rules that match the conditions of GetAccountTaxRequest + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name from which tax settings will be retrieved + * @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.AccountTax|AccountTax}. + * 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/account_tax_service.get_account_tax.js + * region_tag:merchantapi_v1beta_generated_AccountTaxService_GetAccountTax_async + */ + getAccountTax( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|undefined, {}|undefined + ]>; + getAccountTax( + request: protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|null|undefined, + {}|null|undefined>): void; + getAccountTax( + request: protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|null|undefined, + {}|null|undefined>): void; + getAccountTax( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|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.getAccountTax(request, options, callback); + } +/** + * Updates the tax settings of the account. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.AccountTax} request.accountTax + * Required. The tax setting that will be updated + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be 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.AccountTax|AccountTax}. + * 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/account_tax_service.update_account_tax.js + * region_tag:merchantapi_v1beta_generated_AccountTaxService_UpdateAccountTax_async + */ + updateAccountTax( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|undefined, {}|undefined + ]>; + updateAccountTax( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|null|undefined, + {}|null|undefined>): void; + updateAccountTax( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|null|undefined, + {}|null|undefined>): void; + updateAccountTax( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccountTax, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|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({ + 'account_tax.name': request.accountTax!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAccountTax(request, options, callback); + } + + /** + * Lists the tax settings of the sub-accounts only in your + * Merchant Center account. + * This method can only be called on a multi-client account, otherwise it'll + * return an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of account tax. + * Format: accounts/{account} + * @param {number} request.pageSize + * The maximum number of tax settings to return in the response, used for + * paging. + * @param {string} request.pageToken + * The token returned by the previous request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.AccountTax|AccountTax}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAccountTaxAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAccountTax( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccountTax[], + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse + ]>; + listAccountTax( + request: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccountTax>): void; + listAccountTax( + request: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccountTax>): void; + listAccountTax( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccountTax>, + callback?: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccountTax>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccountTax[], + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAccountTax(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of account tax. + * Format: accounts/{account} + * @param {number} request.pageSize + * The maximum number of tax settings to return in the response, used for + * paging. + * @param {string} request.pageToken + * The token returned by the previous request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.AccountTax|AccountTax} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAccountTaxAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAccountTaxStream( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAccountTax']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccountTax.createStream( + this.innerApiCalls.listAccountTax as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAccountTax`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of account tax. + * Format: accounts/{account} + * @param {number} request.pageSize + * The maximum number of tax settings to return in the response, used for + * paging. + * @param {string} request.pageToken + * The token returned by the previous request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.shopping.merchant.accounts.v1beta.AccountTax|AccountTax}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/account_tax_service.list_account_tax.js + * region_tag:merchantapi_v1beta_generated_AccountTaxService_ListAccountTax_async + */ + listAccountTaxAsync( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAccountTax']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccountTax.asyncIterate( + this.innerApiCalls['listAccountTax'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- 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.accountTaxServiceStub && !this._terminated) { + return this.accountTaxServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client_config.json new file mode 100644 index 00000000000..4f2807b57b2 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.AccountTaxService": { + "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": { + "GetAccountTax": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListAccountTax": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateAccountTax": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client.ts new file mode 100644 index 00000000000..f63e55a8e0c --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client.ts @@ -0,0 +1,1527 @@ +// 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, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/accounts_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './accounts_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support Accounts API. + * @class + * @memberof v1beta + */ +export class AccountsServiceClient { + 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}; + accountsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AccountsServiceClient. + * + * @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 AccountsServiceClient({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 AccountsServiceClient; + 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}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAccounts: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accounts'), + listSubAccounts: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accounts') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.shopping.merchant.accounts.v1beta.AccountsService', 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.accountsServiceStub) { + return this.accountsServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.AccountsService. + this.accountsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.AccountsService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.AccountsService, + 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 accountsServiceStubMethods = + ['getAccount', 'createAndConfigureAccount', 'deleteAccount', 'updateAccount', 'listAccounts', 'listSubAccounts']; + for (const methodName of accountsServiceStubMethods) { + const callPromise = this.accountsServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.accountsServiceStub; + } + + /** + * 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 an account from your Merchant Center account. + * After inserting, updating, or deleting an account, it may take several + * minutes before changes take effect. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the account to retrieve. + * Format: `accounts/{account}` + * @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.Account|Account}. + * 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/accounts_service.get_account.js + * region_tag:merchantapi_v1beta_generated_AccountsService_GetAccount_async + */ + getAccount( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|undefined, {}|undefined + ]>; + getAccount( + request: protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|null|undefined, + {}|null|undefined>): void; + getAccount( + request: protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|null|undefined, + {}|null|undefined>): void; + getAccount( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|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.getAccount(request, options, callback); + } +/** + * Creates a standalone Merchant Center account with additional configuration. + * Adds the user that makes the request as an admin for the new account. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.Account} request.account + * Required. The account to be created. + * @param {number[]} [request.users] + * Optional. Users to be added to the account. + * @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 + * 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. + * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. + * 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/accounts_service.create_and_configure_account.js + * region_tag:merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_async + */ + createAndConfigureAccount( + request?: protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|undefined, {}|undefined + ]>; + createAndConfigureAccount( + request: protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|null|undefined, + {}|null|undefined>): void; + createAndConfigureAccount( + request: protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|null|undefined, + {}|null|undefined>): void; + createAndConfigureAccount( + request?: protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|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 || {}; + this.initialize(); + return this.innerApiCalls.createAndConfigureAccount(request, options, callback); + } +/** + * Deletes the specified account regardless of its type: standalone, MCA or + * sub-account. Deleting an MCA leads to the deletion of all of its + * sub-accounts. Executing this method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the account to delete. + * Format: `accounts/{account}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/accounts_service.delete_account.js + * region_tag:merchantapi_v1beta_generated_AccountsService_DeleteAccount_async + */ + deleteAccount( + request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|undefined, {}|undefined + ]>; + deleteAccount( + request: protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|null|undefined, + {}|null|undefined>): void; + deleteAccount( + request: protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|null|undefined, + {}|null|undefined>): void; + deleteAccount( + request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|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.deleteAccount(request, options, callback); + } +/** + * Updates an account regardless of its type: standalone, MCA or sub-account. + * Executing this method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.Account} request.account + * Required. The new version of the account. + * @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.Account|Account}. + * 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/accounts_service.update_account.js + * region_tag:merchantapi_v1beta_generated_AccountsService_UpdateAccount_async + */ + updateAccount( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|undefined, {}|undefined + ]>; + updateAccount( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|null|undefined, + {}|null|undefined>): void; + updateAccount( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|null|undefined, + {}|null|undefined>): void; + updateAccount( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount, + protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|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({ + 'account.name': request.account!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateAccount(request, options, callback); + } + + /** + * Lists accounts accessible to the calling user and matching the + * constraints of the request such as page size or filters. + * This is not just listing the sub-accounts of an MCA, but all accounts the + * calling user has access to including other MCAs, linked accounts, + * standalone accounts and so on. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Returns only accounts that match the + * [filter](/merchant/api/guides/accounts/filter). + * For more details, see the + * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAccountsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAccounts( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount[], + protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse + ]>; + listAccounts( + request: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccount>): void; + listAccounts( + request: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccount>): void; + listAccounts( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccount>, + callback?: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccount>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount[], + protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse + ]>|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 || {}; + this.initialize(); + return this.innerApiCalls.listAccounts(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Returns only accounts that match the + * [filter](/merchant/api/guides/accounts/filter). + * For more details, see the + * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAccountsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAccountsStream( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listAccounts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccounts.createStream( + this.innerApiCalls.listAccounts as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAccounts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. Returns only accounts that match the + * [filter](/merchant/api/guides/accounts/filter). + * For more details, see the + * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/accounts_service.list_accounts.js + * region_tag:merchantapi_v1beta_generated_AccountsService_ListAccounts_async + */ + listAccountsAsync( + request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listAccounts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAccounts.asyncIterate( + this.innerApiCalls['listAccounts'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List all sub-accounts for a given multi client account. This is a + * convenience wrapper for the more powerful `ListAccounts` method. This + * method will produce the same results as calling `ListsAccounts` with the + * following filter: + * `relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.provider + * Required. The parent account. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSubAccountsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubAccounts( + request?: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount[], + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse + ]>; + listSubAccounts( + request: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccount>): void; + listSubAccounts( + request: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccount>): void; + listSubAccounts( + request?: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccount>, + callback?: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IAccount>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IAccount[], + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse + ]>|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({ + 'provider': request.provider ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSubAccounts(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.provider + * Required. The parent account. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSubAccountsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSubAccountsStream( + request?: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'provider': request.provider ?? '', + }); + const defaultCallSettings = this._defaults['listSubAccounts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSubAccounts.createStream( + this.innerApiCalls.listSubAccounts as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSubAccounts`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.provider + * Required. The parent account. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of accounts to return. The service may return + * fewer than this value. If unspecified, at most 250 accounts are returned. + * The maximum value is 500; values above 500 are coerced to 500. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListAccounts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListAccounts` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/accounts_service.list_sub_accounts.js + * region_tag:merchantapi_v1beta_generated_AccountsService_ListSubAccounts_async + */ + listSubAccountsAsync( + request?: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'provider': request.provider ?? '', + }); + const defaultCallSettings = this._defaults['listSubAccounts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSubAccounts.asyncIterate( + this.innerApiCalls['listSubAccounts'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- 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.accountsServiceStub && !this._terminated) { + return this.accountsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client_config.json new file mode 100644 index 00000000000..2cfc899d509 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client_config.json @@ -0,0 +1,68 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.AccountsService": { + "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": { + "GetAccount": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateAndConfigureAccount": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteAccount": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateAccount": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListAccounts": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListSubAccounts": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client.ts new file mode 100644 index 00000000000..2ed5f37bb51 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client.ts @@ -0,0 +1,982 @@ +// 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client_config.json new file mode 100644 index 00000000000..76605ca23ce --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client.ts new file mode 100644 index 00000000000..355fbcedc22 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client.ts @@ -0,0 +1,983 @@ +// 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/business_identity_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './business_identity_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support [business + * identity](https://support.google.com/merchants/answer/12564247) API. + * @class + * @memberof v1beta + */ +export class BusinessIdentityServiceClient { + 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}; + businessIdentityServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BusinessIdentityServiceClient. + * + * @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 BusinessIdentityServiceClient({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 BusinessIdentityServiceClient; + 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.BusinessIdentityService', 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.businessIdentityServiceStub) { + return this.businessIdentityServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.BusinessIdentityService. + this.businessIdentityServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.BusinessIdentityService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.BusinessIdentityService, + 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 businessIdentityServiceStubMethods = + ['getBusinessIdentity', 'updateBusinessIdentity']; + for (const methodName of businessIdentityServiceStubMethods) { + const callPromise = this.businessIdentityServiceStub.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.businessIdentityServiceStub; + } + + /** + * 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 business identity of an account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the business identity. + * Format: `accounts/{account}/businessIdentity` + * @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.BusinessIdentity|BusinessIdentity}. + * 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/business_identity_service.get_business_identity.js + * region_tag:merchantapi_v1beta_generated_BusinessIdentityService_GetBusinessIdentity_async + */ + getBusinessIdentity( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|undefined, {}|undefined + ]>; + getBusinessIdentity( + request: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|null|undefined, + {}|null|undefined>): void; + getBusinessIdentity( + request: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|null|undefined, + {}|null|undefined>): void; + getBusinessIdentity( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|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.getBusinessIdentity(request, options, callback); + } +/** + * Updates the business identity of an account. Executing this method requires + * admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity} request.businessIdentity + * Required. The new version of the business identity. + * @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.BusinessIdentity|BusinessIdentity}. + * 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/business_identity_service.update_business_identity.js + * region_tag:merchantapi_v1beta_generated_BusinessIdentityService_UpdateBusinessIdentity_async + */ + updateBusinessIdentity( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|undefined, {}|undefined + ]>; + updateBusinessIdentity( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|null|undefined, + {}|null|undefined>): void; + updateBusinessIdentity( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|null|undefined, + {}|null|undefined>): void; + updateBusinessIdentity( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|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({ + 'business_identity.name': request.businessIdentity!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateBusinessIdentity(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.businessIdentityServiceStub && !this._terminated) { + return this.businessIdentityServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client_config.json new file mode 100644 index 00000000000..3f53a2e5cc4 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client_config.json @@ -0,0 +1,48 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.BusinessIdentityService": { + "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": { + "GetBusinessIdentity": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateBusinessIdentity": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client.ts new file mode 100644 index 00000000000..a55478407e8 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client.ts @@ -0,0 +1,982 @@ +// 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/business_info_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './business_info_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support business info API. + * @class + * @memberof v1beta + */ +export class BusinessInfoServiceClient { + 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}; + businessInfoServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BusinessInfoServiceClient. + * + * @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 BusinessInfoServiceClient({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 BusinessInfoServiceClient; + 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.BusinessInfoService', 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.businessInfoServiceStub) { + return this.businessInfoServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.BusinessInfoService. + this.businessInfoServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.BusinessInfoService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.BusinessInfoService, + 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 businessInfoServiceStubMethods = + ['getBusinessInfo', 'updateBusinessInfo']; + for (const methodName of businessInfoServiceStubMethods) { + const callPromise = this.businessInfoServiceStub.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.businessInfoServiceStub; + } + + /** + * 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 business info of an account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the business info. + * Format: `accounts/{account}/businessInfo` + * @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.BusinessInfo|BusinessInfo}. + * 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/business_info_service.get_business_info.js + * region_tag:merchantapi_v1beta_generated_BusinessInfoService_GetBusinessInfo_async + */ + getBusinessInfo( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|undefined, {}|undefined + ]>; + getBusinessInfo( + request: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|null|undefined, + {}|null|undefined>): void; + getBusinessInfo( + request: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|null|undefined, + {}|null|undefined>): void; + getBusinessInfo( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|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.getBusinessInfo(request, options, callback); + } +/** + * Updates the business info of an account. Executing this method requires + * admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.BusinessInfo} request.businessInfo + * Required. The new version of the business info. + * @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.BusinessInfo|BusinessInfo}. + * 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/business_info_service.update_business_info.js + * region_tag:merchantapi_v1beta_generated_BusinessInfoService_UpdateBusinessInfo_async + */ + updateBusinessInfo( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|undefined, {}|undefined + ]>; + updateBusinessInfo( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|null|undefined, + {}|null|undefined>): void; + updateBusinessInfo( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|null|undefined, + {}|null|undefined>): void; + updateBusinessInfo( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, + protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|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({ + 'business_info.name': request.businessInfo!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateBusinessInfo(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.businessInfoServiceStub && !this._terminated) { + return this.businessInfoServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client_config.json new file mode 100644 index 00000000000..df02eede533 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client_config.json @@ -0,0 +1,48 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.BusinessInfoService": { + "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": { + "GetBusinessInfo": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateBusinessInfo": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client.ts new file mode 100644 index 00000000000..8df5d3a128f --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client.ts @@ -0,0 +1,997 @@ +// 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/email_preferences_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './email_preferences_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support the `EmailPreferences` API. + * + * This service only permits retrieving and updating email preferences for the + * authenticated user. + * @class + * @memberof v1beta + */ +export class EmailPreferencesServiceClient { + 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}; + emailPreferencesServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EmailPreferencesServiceClient. + * + * @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 EmailPreferencesServiceClient({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 EmailPreferencesServiceClient; + 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.EmailPreferencesService', 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.emailPreferencesServiceStub) { + return this.emailPreferencesServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.EmailPreferencesService. + this.emailPreferencesServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.EmailPreferencesService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.EmailPreferencesService, + 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 emailPreferencesServiceStubMethods = + ['getEmailPreferences', 'updateEmailPreferences']; + for (const methodName of emailPreferencesServiceStubMethods) { + const callPromise = this.emailPreferencesServiceStub.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.emailPreferencesServiceStub; + } + + /** + * 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 -- + // ------------------- +/** + * Returns the email preferences for a Merchant Center account user. + * + * Use the name=accounts/* /users/me/emailPreferences alias to get preferences + * for the authenticated user. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `EmailPreferences` resource. + * Format: `accounts/{account}/users/{email}/emailPreferences` + * @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.EmailPreferences|EmailPreferences}. + * 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/email_preferences_service.get_email_preferences.js + * region_tag:merchantapi_v1beta_generated_EmailPreferencesService_GetEmailPreferences_async + */ + getEmailPreferences( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|undefined, {}|undefined + ]>; + getEmailPreferences( + request: protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|null|undefined, + {}|null|undefined>): void; + getEmailPreferences( + request: protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|null|undefined, + {}|null|undefined>): void; + getEmailPreferences( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|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.getEmailPreferences(request, options, callback); + } +/** + * Updates the email preferences for a Merchant Center account user. MCA users + * should specify the MCA account rather than a sub-account of the MCA. + * + * Preferences which are not explicitly selected in the update mask will not + * be updated. + * + * It is invalid for updates to specify an UNCONFIRMED opt-in status value. + * + * Use the name=accounts/* /users/me/emailPreferences alias to update + * preferences + * for the authenticated user. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.EmailPreferences} request.emailPreferences + * Required. Email Preferences to be updated. + * @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.EmailPreferences|EmailPreferences}. + * 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/email_preferences_service.update_email_preferences.js + * region_tag:merchantapi_v1beta_generated_EmailPreferencesService_UpdateEmailPreferences_async + */ + updateEmailPreferences( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|undefined, {}|undefined + ]>; + updateEmailPreferences( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|null|undefined, + {}|null|undefined>): void; + updateEmailPreferences( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|null|undefined, + {}|null|undefined>): void; + updateEmailPreferences( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, + protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|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({ + 'email_preferences.name': request.emailPreferences!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEmailPreferences(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.emailPreferencesServiceStub && !this._terminated) { + return this.emailPreferencesServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client_config.json new file mode 100644 index 00000000000..e16984f64b8 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client_config.json @@ -0,0 +1,48 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.EmailPreferencesService": { + "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": { + "GetEmailPreferences": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateEmailPreferences": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/gapic_metadata.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/gapic_metadata.json new file mode 100644 index 00000000000..effe3375d06 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/gapic_metadata.json @@ -0,0 +1,701 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.shopping.merchant.accounts.v1beta", + "libraryPackage": "@google-shopping/accounts", + "services": { + "AccountIssueService": { + "clients": { + "grpc": { + "libraryClient": "AccountIssueServiceClient", + "rpcs": { + "ListAccountIssues": { + "methods": [ + "listAccountIssues", + "listAccountIssuesStream", + "listAccountIssuesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AccountIssueServiceClient", + "rpcs": { + "ListAccountIssues": { + "methods": [ + "listAccountIssues", + "listAccountIssuesStream", + "listAccountIssuesAsync" + ] + } + } + } + } + }, + "AccountsService": { + "clients": { + "grpc": { + "libraryClient": "AccountsServiceClient", + "rpcs": { + "GetAccount": { + "methods": [ + "getAccount" + ] + }, + "CreateAndConfigureAccount": { + "methods": [ + "createAndConfigureAccount" + ] + }, + "DeleteAccount": { + "methods": [ + "deleteAccount" + ] + }, + "UpdateAccount": { + "methods": [ + "updateAccount" + ] + }, + "ListAccounts": { + "methods": [ + "listAccounts", + "listAccountsStream", + "listAccountsAsync" + ] + }, + "ListSubAccounts": { + "methods": [ + "listSubAccounts", + "listSubAccountsStream", + "listSubAccountsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AccountsServiceClient", + "rpcs": { + "GetAccount": { + "methods": [ + "getAccount" + ] + }, + "CreateAndConfigureAccount": { + "methods": [ + "createAndConfigureAccount" + ] + }, + "DeleteAccount": { + "methods": [ + "deleteAccount" + ] + }, + "UpdateAccount": { + "methods": [ + "updateAccount" + ] + }, + "ListAccounts": { + "methods": [ + "listAccounts", + "listAccountsStream", + "listAccountsAsync" + ] + }, + "ListSubAccounts": { + "methods": [ + "listSubAccounts", + "listSubAccountsStream", + "listSubAccountsAsync" + ] + } + } + } + } + }, + "AccountTaxService": { + "clients": { + "grpc": { + "libraryClient": "AccountTaxServiceClient", + "rpcs": { + "GetAccountTax": { + "methods": [ + "getAccountTax" + ] + }, + "UpdateAccountTax": { + "methods": [ + "updateAccountTax" + ] + }, + "ListAccountTax": { + "methods": [ + "listAccountTax", + "listAccountTaxStream", + "listAccountTaxAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AccountTaxServiceClient", + "rpcs": { + "GetAccountTax": { + "methods": [ + "getAccountTax" + ] + }, + "UpdateAccountTax": { + "methods": [ + "updateAccountTax" + ] + }, + "ListAccountTax": { + "methods": [ + "listAccountTax", + "listAccountTaxStream", + "listAccountTaxAsync" + ] + } + } + } + } + }, + "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": { + "libraryClient": "BusinessIdentityServiceClient", + "rpcs": { + "GetBusinessIdentity": { + "methods": [ + "getBusinessIdentity" + ] + }, + "UpdateBusinessIdentity": { + "methods": [ + "updateBusinessIdentity" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BusinessIdentityServiceClient", + "rpcs": { + "GetBusinessIdentity": { + "methods": [ + "getBusinessIdentity" + ] + }, + "UpdateBusinessIdentity": { + "methods": [ + "updateBusinessIdentity" + ] + } + } + } + } + }, + "BusinessInfoService": { + "clients": { + "grpc": { + "libraryClient": "BusinessInfoServiceClient", + "rpcs": { + "GetBusinessInfo": { + "methods": [ + "getBusinessInfo" + ] + }, + "UpdateBusinessInfo": { + "methods": [ + "updateBusinessInfo" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BusinessInfoServiceClient", + "rpcs": { + "GetBusinessInfo": { + "methods": [ + "getBusinessInfo" + ] + }, + "UpdateBusinessInfo": { + "methods": [ + "updateBusinessInfo" + ] + } + } + } + } + }, + "EmailPreferencesService": { + "clients": { + "grpc": { + "libraryClient": "EmailPreferencesServiceClient", + "rpcs": { + "GetEmailPreferences": { + "methods": [ + "getEmailPreferences" + ] + }, + "UpdateEmailPreferences": { + "methods": [ + "updateEmailPreferences" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EmailPreferencesServiceClient", + "rpcs": { + "GetEmailPreferences": { + "methods": [ + "getEmailPreferences" + ] + }, + "UpdateEmailPreferences": { + "methods": [ + "updateEmailPreferences" + ] + } + } + } + } + }, + "HomepageService": { + "clients": { + "grpc": { + "libraryClient": "HomepageServiceClient", + "rpcs": { + "GetHomepage": { + "methods": [ + "getHomepage" + ] + }, + "UpdateHomepage": { + "methods": [ + "updateHomepage" + ] + }, + "ClaimHomepage": { + "methods": [ + "claimHomepage" + ] + }, + "UnclaimHomepage": { + "methods": [ + "unclaimHomepage" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "HomepageServiceClient", + "rpcs": { + "GetHomepage": { + "methods": [ + "getHomepage" + ] + }, + "UpdateHomepage": { + "methods": [ + "updateHomepage" + ] + }, + "ClaimHomepage": { + "methods": [ + "claimHomepage" + ] + }, + "UnclaimHomepage": { + "methods": [ + "unclaimHomepage" + ] + } + } + } + } + }, + "OnlineReturnPolicyService": { + "clients": { + "grpc": { + "libraryClient": "OnlineReturnPolicyServiceClient", + "rpcs": { + "GetOnlineReturnPolicy": { + "methods": [ + "getOnlineReturnPolicy" + ] + }, + "ListOnlineReturnPolicies": { + "methods": [ + "listOnlineReturnPolicies", + "listOnlineReturnPoliciesStream", + "listOnlineReturnPoliciesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "OnlineReturnPolicyServiceClient", + "rpcs": { + "GetOnlineReturnPolicy": { + "methods": [ + "getOnlineReturnPolicy" + ] + }, + "ListOnlineReturnPolicies": { + "methods": [ + "listOnlineReturnPolicies", + "listOnlineReturnPoliciesStream", + "listOnlineReturnPoliciesAsync" + ] + } + } + } + } + }, + "ProgramsService": { + "clients": { + "grpc": { + "libraryClient": "ProgramsServiceClient", + "rpcs": { + "GetProgram": { + "methods": [ + "getProgram" + ] + }, + "EnableProgram": { + "methods": [ + "enableProgram" + ] + }, + "DisableProgram": { + "methods": [ + "disableProgram" + ] + }, + "ListPrograms": { + "methods": [ + "listPrograms", + "listProgramsStream", + "listProgramsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProgramsServiceClient", + "rpcs": { + "GetProgram": { + "methods": [ + "getProgram" + ] + }, + "EnableProgram": { + "methods": [ + "enableProgram" + ] + }, + "DisableProgram": { + "methods": [ + "disableProgram" + ] + }, + "ListPrograms": { + "methods": [ + "listPrograms", + "listProgramsStream", + "listProgramsAsync" + ] + } + } + } + } + }, + "RegionsService": { + "clients": { + "grpc": { + "libraryClient": "RegionsServiceClient", + "rpcs": { + "GetRegion": { + "methods": [ + "getRegion" + ] + }, + "CreateRegion": { + "methods": [ + "createRegion" + ] + }, + "UpdateRegion": { + "methods": [ + "updateRegion" + ] + }, + "DeleteRegion": { + "methods": [ + "deleteRegion" + ] + }, + "ListRegions": { + "methods": [ + "listRegions", + "listRegionsStream", + "listRegionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionsServiceClient", + "rpcs": { + "GetRegion": { + "methods": [ + "getRegion" + ] + }, + "CreateRegion": { + "methods": [ + "createRegion" + ] + }, + "UpdateRegion": { + "methods": [ + "updateRegion" + ] + }, + "DeleteRegion": { + "methods": [ + "deleteRegion" + ] + }, + "ListRegions": { + "methods": [ + "listRegions", + "listRegionsStream", + "listRegionsAsync" + ] + } + } + } + } + }, + "ShippingSettingsService": { + "clients": { + "grpc": { + "libraryClient": "ShippingSettingsServiceClient", + "rpcs": { + "GetShippingSettings": { + "methods": [ + "getShippingSettings" + ] + }, + "InsertShippingSettings": { + "methods": [ + "insertShippingSettings" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ShippingSettingsServiceClient", + "rpcs": { + "GetShippingSettings": { + "methods": [ + "getShippingSettings" + ] + }, + "InsertShippingSettings": { + "methods": [ + "insertShippingSettings" + ] + } + } + } + } + }, + "TermsOfServiceAgreementStateService": { + "clients": { + "grpc": { + "libraryClient": "TermsOfServiceAgreementStateServiceClient", + "rpcs": { + "GetTermsOfServiceAgreementState": { + "methods": [ + "getTermsOfServiceAgreementState" + ] + }, + "RetrieveForApplicationTermsOfServiceAgreementState": { + "methods": [ + "retrieveForApplicationTermsOfServiceAgreementState" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TermsOfServiceAgreementStateServiceClient", + "rpcs": { + "GetTermsOfServiceAgreementState": { + "methods": [ + "getTermsOfServiceAgreementState" + ] + }, + "RetrieveForApplicationTermsOfServiceAgreementState": { + "methods": [ + "retrieveForApplicationTermsOfServiceAgreementState" + ] + } + } + } + } + }, + "TermsOfServiceService": { + "clients": { + "grpc": { + "libraryClient": "TermsOfServiceServiceClient", + "rpcs": { + "GetTermsOfService": { + "methods": [ + "getTermsOfService" + ] + }, + "RetrieveLatestTermsOfService": { + "methods": [ + "retrieveLatestTermsOfService" + ] + }, + "AcceptTermsOfService": { + "methods": [ + "acceptTermsOfService" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TermsOfServiceServiceClient", + "rpcs": { + "GetTermsOfService": { + "methods": [ + "getTermsOfService" + ] + }, + "RetrieveLatestTermsOfService": { + "methods": [ + "retrieveLatestTermsOfService" + ] + }, + "AcceptTermsOfService": { + "methods": [ + "acceptTermsOfService" + ] + } + } + } + } + }, + "UserService": { + "clients": { + "grpc": { + "libraryClient": "UserServiceClient", + "rpcs": { + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "UserServiceClient", + "rpcs": { + "GetUser": { + "methods": [ + "getUser" + ] + }, + "CreateUser": { + "methods": [ + "createUser" + ] + }, + "DeleteUser": { + "methods": [ + "deleteUser" + ] + }, + "UpdateUser": { + "methods": [ + "updateUser" + ] + }, + "ListUsers": { + "methods": [ + "listUsers", + "listUsersStream", + "listUsersAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client.ts new file mode 100644 index 00000000000..ba5d2dceaac --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client.ts @@ -0,0 +1,1136 @@ +// 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/homepage_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './homepage_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support an API for a store's homepage. + * @class + * @memberof v1beta + */ +export class HomepageServiceClient { + 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}; + homepageServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of HomepageServiceClient. + * + * @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 HomepageServiceClient({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 HomepageServiceClient; + 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.HomepageService', 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.homepageServiceStub) { + return this.homepageServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.HomepageService. + this.homepageServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.HomepageService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.HomepageService, + 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 homepageServiceStubMethods = + ['getHomepage', 'updateHomepage', 'claimHomepage', 'unclaimHomepage']; + for (const methodName of homepageServiceStubMethods) { + const callPromise = this.homepageServiceStub.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.homepageServiceStub; + } + + /** + * 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 a store's homepage. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the homepage to retrieve. + * Format: `accounts/{account}/homepage` + * @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.Homepage|Homepage}. + * 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/homepage_service.get_homepage.js + * region_tag:merchantapi_v1beta_generated_HomepageService_GetHomepage_async + */ + getHomepage( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|undefined, {}|undefined + ]>; + getHomepage( + request: protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|null|undefined, + {}|null|undefined>): void; + getHomepage( + request: protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|null|undefined, + {}|null|undefined>): void; + getHomepage( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|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.getHomepage(request, options, callback); + } +/** + * Updates a store's homepage. Executing this method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.Homepage} request.homepage + * Required. The new version of the homepage. + * @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.Homepage|Homepage}. + * 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/homepage_service.update_homepage.js + * region_tag:merchantapi_v1beta_generated_HomepageService_UpdateHomepage_async + */ + updateHomepage( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|undefined, {}|undefined + ]>; + updateHomepage( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|null|undefined, + {}|null|undefined>): void; + updateHomepage( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|null|undefined, + {}|null|undefined>): void; + updateHomepage( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|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({ + 'homepage.name': request.homepage!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateHomepage(request, options, callback); + } +/** + * Claims a store's homepage. Executing this method requires admin access. + * + * If the homepage is already claimed, this will recheck the + * verification (unless the merchant is exempted from claiming, which also + * exempts from verification) and return a successful response. If ownership + * can no longer be verified, it will return an error, but it won't clear the + * claim. In case of failure, a canonical error message will be returned: + * * PERMISSION_DENIED: user doesn't have the necessary permissions on this + * MC account; + * * FAILED_PRECONDITION: + * - The account is not a Merchant Center account; + * - MC account doesn't have a homepage; + * - claiming failed (in this case the error message will contain more + * details). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the homepage to claim. + * Format: `accounts/{account}/homepage` + * @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.Homepage|Homepage}. + * 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/homepage_service.claim_homepage.js + * region_tag:merchantapi_v1beta_generated_HomepageService_ClaimHomepage_async + */ + claimHomepage( + request?: protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|undefined, {}|undefined + ]>; + claimHomepage( + request: protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|null|undefined, + {}|null|undefined>): void; + claimHomepage( + request: protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|null|undefined, + {}|null|undefined>): void; + claimHomepage( + request?: protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|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.claimHomepage(request, options, callback); + } +/** + * Unclaims a store's homepage. Executing this method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the homepage to unclaim. + * Format: `accounts/{account}/homepage` + * @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.Homepage|Homepage}. + * 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/homepage_service.unclaim_homepage.js + * region_tag:merchantapi_v1beta_generated_HomepageService_UnclaimHomepage_async + */ + unclaimHomepage( + request?: protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|undefined, {}|undefined + ]>; + unclaimHomepage( + request: protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|null|undefined, + {}|null|undefined>): void; + unclaimHomepage( + request: protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|null|undefined, + {}|null|undefined>): void; + unclaimHomepage( + request?: protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IHomepage, + protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|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.unclaimHomepage(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.homepageServiceStub && !this._terminated) { + return this.homepageServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client_config.json new file mode 100644 index 00000000000..acf219e28d2 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.HomepageService": { + "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": { + "GetHomepage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateHomepage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ClaimHomepage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UnclaimHomepage": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/index.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/index.ts new file mode 100644 index 00000000000..af8a76c6320 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/index.ts @@ -0,0 +1,33 @@ +// 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. ** + +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'; +export {HomepageServiceClient} from './homepage_service_client'; +export {OnlineReturnPolicyServiceClient} from './online_return_policy_service_client'; +export {ProgramsServiceClient} from './programs_service_client'; +export {RegionsServiceClient} from './regions_service_client'; +export {ShippingSettingsServiceClient} from './shipping_settings_service_client'; +export {TermsOfServiceAgreementStateServiceClient} from './terms_of_service_agreement_state_service_client'; +export {TermsOfServiceServiceClient} from './terms_of_service_service_client'; +export {UserServiceClient} from './user_service_client'; diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client.ts new file mode 100644 index 00000000000..db30c65876c --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client.ts @@ -0,0 +1,1128 @@ +// 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, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/online_return_policy_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './online_return_policy_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The service facilitates the management of a merchant's remorse return policy + * configuration, encompassing return policies for both ads and free listings + * ## programs. This API defines the following resource model: + * + * {@link protos.google.shopping.merchant.accounts.v1.OnlineReturnPolicy|OnlineReturnPolicy} + * @class + * @memberof v1beta + */ +export class OnlineReturnPolicyServiceClient { + 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}; + onlineReturnPolicyServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of OnlineReturnPolicyServiceClient. + * + * @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 OnlineReturnPolicyServiceClient({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 OnlineReturnPolicyServiceClient; + 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}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listOnlineReturnPolicies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'onlineReturnPolicies') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService', 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.onlineReturnPolicyServiceStub) { + return this.onlineReturnPolicyServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService. + this.onlineReturnPolicyServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService, + 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 onlineReturnPolicyServiceStubMethods = + ['getOnlineReturnPolicy', 'listOnlineReturnPolicies']; + for (const methodName of onlineReturnPolicyServiceStubMethods) { + const callPromise = this.onlineReturnPolicyServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.onlineReturnPolicyServiceStub; + } + + /** + * 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 -- + // ------------------- +/** + * Gets an existing return policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the return policy to retrieve. + * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` + * @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.OnlineReturnPolicy|OnlineReturnPolicy}. + * 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/online_return_policy_service.get_online_return_policy.js + * region_tag:merchantapi_v1beta_generated_OnlineReturnPolicyService_GetOnlineReturnPolicy_async + */ + getOnlineReturnPolicy( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, + protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|undefined, {}|undefined + ]>; + getOnlineReturnPolicy( + request: protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, + protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|null|undefined, + {}|null|undefined>): void; + getOnlineReturnPolicy( + request: protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, + protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|null|undefined, + {}|null|undefined>): void; + getOnlineReturnPolicy( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, + protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, + protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, + protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|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.getOnlineReturnPolicy(request, options, callback); + } + + /** + * Lists all existing return policies. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The merchant account for which to list return policies. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of `OnlineReturnPolicy` resources to return. + * The service returns fewer than this value if the number of return policies + * for the given merchant is less that than the `pageSize`. The default value + * is 10. The maximum value is 100; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListOnlineReturnPolicies` + * call. Provide the page token to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListOnlineReturnPolicies` must match the call that provided the page + * token. The token returned as + * {@link protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token|nextPageToken} + * in the response to the previous request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy|OnlineReturnPolicy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listOnlineReturnPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listOnlineReturnPolicies( + request?: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[], + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse + ]>; + listOnlineReturnPolicies( + request: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy>): void; + listOnlineReturnPolicies( + request: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy>): void; + listOnlineReturnPolicies( + request?: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy>, + callback?: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[], + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listOnlineReturnPolicies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The merchant account for which to list return policies. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of `OnlineReturnPolicy` resources to return. + * The service returns fewer than this value if the number of return policies + * for the given merchant is less that than the `pageSize`. The default value + * is 10. The maximum value is 100; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListOnlineReturnPolicies` + * call. Provide the page token to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListOnlineReturnPolicies` must match the call that provided the page + * token. The token returned as + * {@link protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token|nextPageToken} + * in the response to the previous request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy|OnlineReturnPolicy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listOnlineReturnPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listOnlineReturnPoliciesStream( + request?: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listOnlineReturnPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOnlineReturnPolicies.createStream( + this.innerApiCalls.listOnlineReturnPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listOnlineReturnPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The merchant account for which to list return policies. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of `OnlineReturnPolicy` resources to return. + * The service returns fewer than this value if the number of return policies + * for the given merchant is less that than the `pageSize`. The default value + * is 10. The maximum value is 100; If a value higher than the maximum is + * specified, then the `pageSize` will default to the maximum + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListOnlineReturnPolicies` + * call. Provide the page token to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListOnlineReturnPolicies` must match the call that provided the page + * token. The token returned as + * {@link protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token|nextPageToken} + * in the response to the previous request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy|OnlineReturnPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js + * region_tag:merchantapi_v1beta_generated_OnlineReturnPolicyService_ListOnlineReturnPolicies_async + */ + listOnlineReturnPoliciesAsync( + request?: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listOnlineReturnPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listOnlineReturnPolicies.asyncIterate( + this.innerApiCalls['listOnlineReturnPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- 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.onlineReturnPolicyServiceStub && !this._terminated) { + return this.onlineReturnPolicyServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client_config.json new file mode 100644 index 00000000000..99ff0cb844f --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client_config.json @@ -0,0 +1,48 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService": { + "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": { + "GetOnlineReturnPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListOnlineReturnPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client.ts new file mode 100644 index 00000000000..2c01f3f53c4 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client.ts @@ -0,0 +1,1254 @@ +// 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, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/programs_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './programs_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for program management. + * + * Programs provide a mechanism for adding functionality to merchant accounts. A + * typical example of this is the [Free product + * listings](https://support.google.com/merchants/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) + * program, which enables products from a merchant's store to be shown across + * Google for free. + * + * This service exposes methods to retrieve a merchant's + * participation in all available programs, in addition to methods for + * explicitly enabling or disabling participation in each program. + * @class + * @memberof v1beta + */ +export class ProgramsServiceClient { + 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}; + programsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ProgramsServiceClient. + * + * @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 ProgramsServiceClient({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 ProgramsServiceClient; + 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}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listPrograms: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'programs') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.shopping.merchant.accounts.v1beta.ProgramsService', 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.programsServiceStub) { + return this.programsServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.ProgramsService. + this.programsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.ProgramsService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.ProgramsService, + 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 programsServiceStubMethods = + ['getProgram', 'listPrograms', 'enableProgram', 'disableProgram']; + for (const methodName of programsServiceStubMethods) { + const callPromise = this.programsServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.programsServiceStub; + } + + /** + * 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 specified program for the account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the program to retrieve. + * Format: `accounts/{account}/programs/{program}` + * @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.Program|Program}. + * 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/programs_service.get_program.js + * region_tag:merchantapi_v1beta_generated_ProgramsService_GetProgram_async + */ + getProgram( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|undefined, {}|undefined + ]>; + getProgram( + request: protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|null|undefined, + {}|null|undefined>): void; + getProgram( + request: protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|null|undefined, + {}|null|undefined>): void; + getProgram( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|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.getProgram(request, options, callback); + } +/** + * Enable participation in the specified program for the account. Executing + * this method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the program for which to enable participation for the + * given account. Format: `accounts/{account}/programs/{program}` + * @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.Program|Program}. + * 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/programs_service.enable_program.js + * region_tag:merchantapi_v1beta_generated_ProgramsService_EnableProgram_async + */ + enableProgram( + request?: protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|undefined, {}|undefined + ]>; + enableProgram( + request: protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|null|undefined, + {}|null|undefined>): void; + enableProgram( + request: protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|null|undefined, + {}|null|undefined>): void; + enableProgram( + request?: protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|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.enableProgram(request, options, callback); + } +/** + * Disable participation in the specified program for the account. Executing + * this method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the program for which to disable participation for + * the given account. Format: `accounts/{account}/programs/{program}` + * @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.Program|Program}. + * 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/programs_service.disable_program.js + * region_tag:merchantapi_v1beta_generated_ProgramsService_DisableProgram_async + */ + disableProgram( + request?: protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|undefined, {}|undefined + ]>; + disableProgram( + request: protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|null|undefined, + {}|null|undefined>): void; + disableProgram( + request: protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|null|undefined, + {}|null|undefined>): void; + disableProgram( + request?: protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IProgram, + protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|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.disableProgram(request, options, callback); + } + + /** + * Retrieves all programs for the account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the account for which to retrieve all programs. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of programs to return in a single response. If + * unspecified (or 0), a default size of 1000 is used. The maximum value is + * 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A continuation token, received from a previous `ListPrograms` + * call. Provide this to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.Program|Program}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listProgramsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPrograms( + request?: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IProgram[], + protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse + ]>; + listPrograms( + request: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IProgram>): void; + listPrograms( + request: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IProgram>): void; + listPrograms( + request?: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IProgram>, + callback?: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IProgram>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IProgram[], + protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listPrograms(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the account for which to retrieve all programs. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of programs to return in a single response. If + * unspecified (or 0), a default size of 1000 is used. The maximum value is + * 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A continuation token, received from a previous `ListPrograms` + * call. Provide this to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Program|Program} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listProgramsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listProgramsStream( + request?: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPrograms']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrograms.createStream( + this.innerApiCalls.listPrograms as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listPrograms`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the account for which to retrieve all programs. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of programs to return in a single response. If + * unspecified (or 0), a default size of 1000 is used. The maximum value is + * 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A continuation token, received from a previous `ListPrograms` + * call. Provide this to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.shopping.merchant.accounts.v1beta.Program|Program}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/programs_service.list_programs.js + * region_tag:merchantapi_v1beta_generated_ProgramsService_ListPrograms_async + */ + listProgramsAsync( + request?: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPrograms']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrograms.asyncIterate( + this.innerApiCalls['listPrograms'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- 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.programsServiceStub && !this._terminated) { + return this.programsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client_config.json new file mode 100644 index 00000000000..aa73367335c --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.ProgramsService": { + "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": { + "GetProgram": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListPrograms": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "EnableProgram": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DisableProgram": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client.ts new file mode 100644 index 00000000000..244c2b72795 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client.ts @@ -0,0 +1,1340 @@ +// 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, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/regions_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './regions_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manages regions configuration. + * + * This API defines the following resource model: + * + * - {@link protos.google.shopping.merchant.accounts.v1main.Region|Region} + * @class + * @memberof v1beta + */ +export class RegionsServiceClient { + 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}; + regionsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionsServiceClient. + * + * @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 RegionsServiceClient({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 RegionsServiceClient; + 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}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listRegions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'regions') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.shopping.merchant.accounts.v1beta.RegionsService', 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.regionsServiceStub) { + return this.regionsServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.RegionsService. + this.regionsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.RegionsService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.RegionsService, + 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 regionsServiceStubMethods = + ['getRegion', 'createRegion', 'updateRegion', 'deleteRegion', 'listRegions']; + for (const methodName of regionsServiceStubMethods) { + const callPromise = this.regionsServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.regionsServiceStub; + } + + /** + * 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 a region defined in your Merchant Center account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the region to retrieve. + * Format: `accounts/{account}/regions/{region}` + * @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.Region|Region}. + * 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/regions_service.get_region.js + * region_tag:merchantapi_v1beta_generated_RegionsService_GetRegion_async + */ + getRegion( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|undefined, {}|undefined + ]>; + getRegion( + request: protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|null|undefined, + {}|null|undefined>): void; + getRegion( + request: protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|null|undefined, + {}|null|undefined>): void; + getRegion( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|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.getRegion(request, options, callback); + } +/** + * Creates a region definition in your Merchant Center account. Executing this + * method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account to create a region for. + * Format: `accounts/{account}` + * @param {string} request.regionId + * Required. The identifier for the region, unique over all regions of the + * same account. + * @param {google.shopping.merchant.accounts.v1beta.Region} request.region + * Required. The region to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Region|Region}. + * 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/regions_service.create_region.js + * region_tag:merchantapi_v1beta_generated_RegionsService_CreateRegion_async + */ + createRegion( + request?: protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|undefined, {}|undefined + ]>; + createRegion( + request: protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|null|undefined, + {}|null|undefined>): void; + createRegion( + request: protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|null|undefined, + {}|null|undefined>): void; + createRegion( + request?: protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createRegion(request, options, callback); + } +/** + * Updates a region definition in your Merchant Center account. Executing this + * method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.Region} request.region + * Required. The updated region. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The comma-separated field mask indicating the fields to update. + * Example: + * `"displayName,postalCodeArea.regionCode"`. + * @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.Region|Region}. + * 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/regions_service.update_region.js + * region_tag:merchantapi_v1beta_generated_RegionsService_UpdateRegion_async + */ + updateRegion( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|undefined, {}|undefined + ]>; + updateRegion( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|null|undefined, + {}|null|undefined>): void; + updateRegion( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|null|undefined, + {}|null|undefined>): void; + updateRegion( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IRegion, + protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|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({ + 'region.name': request.region!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateRegion(request, options, callback); + } +/** + * Deletes a region definition from your Merchant Center account. Executing + * this method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the region to delete. + * Format: `accounts/{account}/regions/{region}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/regions_service.delete_region.js + * region_tag:merchantapi_v1beta_generated_RegionsService_DeleteRegion_async + */ + deleteRegion( + request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|undefined, {}|undefined + ]>; + deleteRegion( + request: protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|null|undefined, + {}|null|undefined>): void; + deleteRegion( + request: protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|null|undefined, + {}|null|undefined>): void; + deleteRegion( + request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|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.deleteRegion(request, options, callback); + } + + /** + * Lists the regions in your Merchant Center account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account to list regions for. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of regions to return. The service may return + * fewer than this value. + * If unspecified, at most 50 regions will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRegions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListRegions` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.Region|Region}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRegionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRegions( + request?: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IRegion[], + protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse + ]>; + listRegions( + request: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IRegion>): void; + listRegions( + request: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IRegion>): void; + listRegions( + request?: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IRegion>, + callback?: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IRegion>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IRegion[], + protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listRegions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account to list regions for. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of regions to return. The service may return + * fewer than this value. + * If unspecified, at most 50 regions will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRegions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListRegions` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Region|Region} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRegionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRegionsStream( + request?: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRegions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRegions.createStream( + this.innerApiCalls.listRegions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listRegions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account to list regions for. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of regions to return. The service may return + * fewer than this value. + * If unspecified, at most 50 regions will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListRegions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListRegions` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.shopping.merchant.accounts.v1beta.Region|Region}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/regions_service.list_regions.js + * region_tag:merchantapi_v1beta_generated_RegionsService_ListRegions_async + */ + listRegionsAsync( + request?: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRegions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRegions.asyncIterate( + this.innerApiCalls['listRegions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- 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.regionsServiceStub && !this._terminated) { + return this.regionsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client_config.json new file mode 100644 index 00000000000..05c1621e970 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.RegionsService": { + "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": { + "GetRegion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateRegion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateRegion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteRegion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListRegions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client.ts new file mode 100644 index 00000000000..1a0734e0f7e --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client.ts @@ -0,0 +1,984 @@ +// 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/shipping_settings_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './shipping_settings_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to get method call shipping setting information per Merchant API + * method. + * @class + * @memberof v1beta + */ +export class ShippingSettingsServiceClient { + 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}; + shippingSettingsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ShippingSettingsServiceClient. + * + * @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 ShippingSettingsServiceClient({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 ShippingSettingsServiceClient; + 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.ShippingSettingsService', 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.shippingSettingsServiceStub) { + return this.shippingSettingsServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.ShippingSettingsService. + this.shippingSettingsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.ShippingSettingsService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.ShippingSettingsService, + 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 shippingSettingsServiceStubMethods = + ['getShippingSettings', 'insertShippingSettings']; + for (const methodName of shippingSettingsServiceStubMethods) { + const callPromise = this.shippingSettingsServiceStub.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.shippingSettingsServiceStub; + } + + /** + * 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 -- + // ------------------- +/** + * Retrieve shipping setting information. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the shipping setting to retrieve. + * Format: `accounts/{account}/shippingsetting` + * @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.ShippingSettings|ShippingSettings}. + * 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/shipping_settings_service.get_shipping_settings.js + * region_tag:merchantapi_v1beta_generated_ShippingSettingsService_GetShippingSettings_async + */ + getShippingSettings( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|undefined, {}|undefined + ]>; + getShippingSettings( + request: protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|null|undefined, + {}|null|undefined>): void; + getShippingSettings( + request: protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|null|undefined, + {}|null|undefined>): void; + getShippingSettings( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|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.getShippingSettings(request, options, callback); + } +/** + * Replace the shipping setting of a merchant with the request shipping + * setting. Executing this method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account where this product will be inserted. + * Format: accounts/{account} + * @param {google.shopping.merchant.accounts.v1beta.ShippingSettings} request.shippingSetting + * Required. The new version of the account. + * @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.ShippingSettings|ShippingSettings}. + * 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/shipping_settings_service.insert_shipping_settings.js + * region_tag:merchantapi_v1beta_generated_ShippingSettingsService_InsertShippingSettings_async + */ + insertShippingSettings( + request?: protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|undefined, {}|undefined + ]>; + insertShippingSettings( + request: protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|null|undefined, + {}|null|undefined>): void; + insertShippingSettings( + request: protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|null|undefined, + {}|null|undefined>): void; + insertShippingSettings( + request?: protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, + protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.insertShippingSettings(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.shippingSettingsServiceStub && !this._terminated) { + return this.shippingSettingsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client_config.json new file mode 100644 index 00000000000..1a72ee658f3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.ShippingSettingsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetShippingSettings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "InsertShippingSettings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client.ts new file mode 100644 index 00000000000..a9cccaf8ab0 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client.ts @@ -0,0 +1,981 @@ +// 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/terms_of_service_agreement_state_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './terms_of_service_agreement_state_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support `TermsOfServiceAgreementState` API. + * @class + * @memberof v1beta + */ +export class TermsOfServiceAgreementStateServiceClient { + 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}; + termsOfServiceAgreementStateServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TermsOfServiceAgreementStateServiceClient. + * + * @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 TermsOfServiceAgreementStateServiceClient({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 TermsOfServiceAgreementStateServiceClient; + 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.TermsOfServiceAgreementStateService', 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.termsOfServiceAgreementStateServiceStub) { + return this.termsOfServiceAgreementStateServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService. + this.termsOfServiceAgreementStateServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService, + 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 termsOfServiceAgreementStateServiceStubMethods = + ['getTermsOfServiceAgreementState', 'retrieveForApplicationTermsOfServiceAgreementState']; + for (const methodName of termsOfServiceAgreementStateServiceStubMethods) { + const callPromise = this.termsOfServiceAgreementStateServiceStub.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.termsOfServiceAgreementStateServiceStub; + } + + /** + * 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 -- + // ------------------- +/** + * Returns the state of a terms of service agreement. + * + * @param {Object} request + * The request object that will be sent. + * @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. + * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState|TermsOfServiceAgreementState}. + * 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/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js + * region_tag:merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_GetTermsOfServiceAgreementState_async + */ + getTermsOfServiceAgreementState( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|undefined, {}|undefined + ]>; + getTermsOfServiceAgreementState( + request: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|null|undefined, + {}|null|undefined>): void; + getTermsOfServiceAgreementState( + request: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|null|undefined, + {}|null|undefined>): void; + getTermsOfServiceAgreementState( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|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.getTermsOfServiceAgreementState(request, options, callback); + } +/** + * Retrieves the state of the agreement for the application terms of service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The account for which to get a TermsOfServiceAgreementState + * Format: `accounts/{account}` + * @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.TermsOfServiceAgreementState|TermsOfServiceAgreementState}. + * 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/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js + * region_tag:merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_RetrieveForApplicationTermsOfServiceAgreementState_async + */ + retrieveForApplicationTermsOfServiceAgreementState( + request?: protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|undefined, {}|undefined + ]>; + retrieveForApplicationTermsOfServiceAgreementState( + request: protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|null|undefined, + {}|null|undefined>): void; + retrieveForApplicationTermsOfServiceAgreementState( + request: protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|null|undefined, + {}|null|undefined>): void; + retrieveForApplicationTermsOfServiceAgreementState( + request?: protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState(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.termsOfServiceAgreementStateServiceStub && !this._terminated) { + return this.termsOfServiceAgreementStateServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client_config.json new file mode 100644 index 00000000000..312be76fc62 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client_config.json @@ -0,0 +1,48 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService": { + "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": { + "GetTermsOfServiceAgreementState": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "RetrieveForApplicationTermsOfServiceAgreementState": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client.ts new file mode 100644 index 00000000000..387f57285eb --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client.ts @@ -0,0 +1,1056 @@ +// 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/terms_of_service_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './terms_of_service_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support `TermsOfService` API. + * @class + * @memberof v1beta + */ +export class TermsOfServiceServiceClient { + 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}; + termsOfServiceServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TermsOfServiceServiceClient. + * + * @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 TermsOfServiceServiceClient({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 TermsOfServiceServiceClient; + 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.TermsOfServiceService', 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.termsOfServiceServiceStub) { + return this.termsOfServiceServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.TermsOfServiceService. + this.termsOfServiceServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.TermsOfServiceService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.TermsOfServiceService, + 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 termsOfServiceServiceStubMethods = + ['getTermsOfService', 'retrieveLatestTermsOfService', 'acceptTermsOfService']; + for (const methodName of termsOfServiceServiceStubMethods) { + const callPromise = this.termsOfServiceServiceStub.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.termsOfServiceServiceStub; + } + + /** + * 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 `TermsOfService` associated with the provided version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * @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.TermsOfService|TermsOfService}. + * 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/terms_of_service_service.get_terms_of_service.js + * region_tag:merchantapi_v1beta_generated_TermsOfServiceService_GetTermsOfService_async + */ + getTermsOfService( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|undefined, {}|undefined + ]>; + getTermsOfService( + request: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|null|undefined, + {}|null|undefined>): void; + getTermsOfService( + request: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|null|undefined, + {}|null|undefined>): void; + getTermsOfService( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|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.getTermsOfService(request, options, callback); + } +/** + * Retrieves the latest version of the `TermsOfService` for a given `kind` and + * `region_code`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.regionCode + * 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 + * 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. + * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.TermsOfService|TermsOfService}. + * 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/terms_of_service_service.retrieve_latest_terms_of_service.js + * region_tag:merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_async + */ + retrieveLatestTermsOfService( + request?: protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|undefined, {}|undefined + ]>; + retrieveLatestTermsOfService( + request: protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|null|undefined, + {}|null|undefined>): void; + retrieveLatestTermsOfService( + request: protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|null|undefined, + {}|null|undefined>): void; + retrieveLatestTermsOfService( + request?: protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, + protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|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 || {}; + this.initialize(); + return this.innerApiCalls.retrieveLatestTermsOfService(request, options, callback); + } +/** + * Accepts a `TermsOfService`. Executing this method requires admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the terms of service version. + * Format: `termsOfService/{version}` + * @param {string} request.account + * Required. The account for which to accept the ToS. + * @param {string} request.regionCode + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js + * region_tag:merchantapi_v1beta_generated_TermsOfServiceService_AcceptTermsOfService_async + */ + acceptTermsOfService( + request?: protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|undefined, {}|undefined + ]>; + acceptTermsOfService( + request: protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|null|undefined, + {}|null|undefined>): void; + acceptTermsOfService( + request: protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|null|undefined, + {}|null|undefined>): void; + acceptTermsOfService( + request?: protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|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.acceptTermsOfService(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.termsOfServiceServiceStub && !this._terminated) { + return this.termsOfServiceServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client_config.json new file mode 100644 index 00000000000..526f7bf05ce --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.TermsOfServiceService": { + "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": { + "GetTermsOfService": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "RetrieveLatestTermsOfService": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "AcceptTermsOfService": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client.ts new file mode 100644 index 00000000000..058b3cd4045 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client.ts @@ -0,0 +1,1341 @@ +// 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, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/user_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './user_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service to support user API. + * @class + * @memberof v1beta + */ +export class UserServiceClient { + 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}; + userServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of UserServiceClient. + * + * @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 UserServiceClient({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 UserServiceClient; + 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}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listUsers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'users') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.shopping.merchant.accounts.v1beta.UserService', 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.userServiceStub) { + return this.userServiceStub; + } + + // Put together the "service stub" for + // google.shopping.merchant.accounts.v1beta.UserService. + this.userServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.UserService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.shopping.merchant.accounts.v1beta.UserService, + 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 userServiceStubMethods = + ['getUser', 'createUser', 'deleteUser', 'updateUser', 'listUsers']; + for (const methodName of userServiceStubMethods) { + const callPromise = this.userServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.userServiceStub; + } + + /** + * 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 a Merchant Center account user. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the user to retrieve. + * Format: `accounts/{account}/users/{email}` + * + * It is also possible to retrieve the user corresponding to the caller by + * using `me` rather than an email address as in + * `accounts/{account}/users/me`. + * @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.User|User}. + * 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/user_service.get_user.js + * region_tag:merchantapi_v1beta_generated_UserService_GetUser_async + */ + getUser( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|undefined, {}|undefined + ]>; + getUser( + request: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|null|undefined, + {}|null|undefined>): void; + getUser( + request: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|null|undefined, + {}|null|undefined>): void; + getUser( + request?: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|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.getUser(request, options, callback); + } +/** + * Creates a Merchant Center account user. Executing this method requires + * admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the account for which a user will be + * created. Format: `accounts/{account}` + * @param {string} request.userId + * Required. The email address of the user (for example, + * `john.doe@gmail.com`). + * @param {google.shopping.merchant.accounts.v1beta.User} request.user + * Required. The user to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.User|User}. + * 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/user_service.create_user.js + * region_tag:merchantapi_v1beta_generated_UserService_CreateUser_async + */ + createUser( + request?: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|undefined, {}|undefined + ]>; + createUser( + request: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|null|undefined, + {}|null|undefined>): void; + createUser( + request: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|null|undefined, + {}|null|undefined>): void; + createUser( + request?: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createUser(request, options, callback); + } +/** + * Deletes a Merchant Center account user. Executing this method requires + * admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the user to delete. + * Format: `accounts/{account}/users/{email}` + * + * It is also possible to delete the user corresponding to the caller by using + * `me` rather than an email address as in `accounts/{account}/users/me`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/user_service.delete_user.js + * region_tag:merchantapi_v1beta_generated_UserService_DeleteUser_async + */ + deleteUser( + request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|undefined, {}|undefined + ]>; + deleteUser( + request: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|null|undefined, + {}|null|undefined>): void; + deleteUser( + request: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|null|undefined, + {}|null|undefined>): void; + deleteUser( + request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|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.deleteUser(request, options, callback); + } +/** + * Updates a Merchant Center account user. Executing this method requires + * admin access. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.shopping.merchant.accounts.v1beta.User} request.user + * Required. The new version of the user. + * + * Use `me` to refer to your own email address, for example + * `accounts/{account}/users/me`. + * @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.User|User}. + * 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/user_service.update_user.js + * region_tag:merchantapi_v1beta_generated_UserService_UpdateUser_async + */ + updateUser( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|undefined, {}|undefined + ]>; + updateUser( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, + options: CallOptions, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|null|undefined, + {}|null|undefined>): void; + updateUser( + request: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, + callback: Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|null|undefined, + {}|null|undefined>): void; + updateUser( + request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IUser, + protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'user.name': request.user!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateUser(request, options, callback); + } + + /** + * Lists all users of a Merchant Center account. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of users. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of users to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListUsers` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListUsers` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.User|User}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUsers( + request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + options?: CallOptions): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IUser[], + protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse + ]>; + listUsers( + request: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IUser>): void; + listUsers( + request: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + callback: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IUser>): void; + listUsers( + request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IUser>, + callback?: PaginationCallback< + protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse|null|undefined, + protos.google.shopping.merchant.accounts.v1beta.IUser>): + Promise<[ + protos.google.shopping.merchant.accounts.v1beta.IUser[], + protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest|null, + protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listUsers(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of users. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of users to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListUsers` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListUsers` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.User|User} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUsersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUsersStream( + request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsers.createStream( + this.innerApiCalls.listUsers as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUsers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of users. + * Format: `accounts/{account}` + * @param {number} [request.pageSize] + * Optional. The maximum number of users to return. The service may return + * fewer than this value. If unspecified, at most 50 users will be returned. + * The maximum value is 100; values above 100 will be coerced to 100 + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListUsers` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListUsers` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.shopping.merchant.accounts.v1beta.User|User}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta/user_service.list_users.js + * region_tag:merchantapi_v1beta_generated_UserService_ListUsers_async + */ + listUsersAsync( + request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsers.asyncIterate( + this.innerApiCalls['listUsers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- 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.userServiceStub && !this._terminated) { + return this.userServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client_config.json new file mode 100644 index 00000000000..fcd414e87d4 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.shopping.merchant.accounts.v1beta.UserService": { + "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": { + "GetUser": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateUser": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteUser": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateUser": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListUsers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_proto_list.json new file mode 100644 index 00000000000..28ca4b888d3 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..d80628c5370 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.js @@ -0,0 +1,41 @@ +// 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. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const accounts = require('@google-shopping/accounts'); + +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(); + const emailPreferencesServiceClient = new accounts.EmailPreferencesServiceClient(); + const homepageServiceClient = new accounts.HomepageServiceClient(); + const onlineReturnPolicyServiceClient = new accounts.OnlineReturnPolicyServiceClient(); + const programsServiceClient = new accounts.ProgramsServiceClient(); + const regionsServiceClient = new accounts.RegionsServiceClient(); + const shippingSettingsServiceClient = new accounts.ShippingSettingsServiceClient(); + const termsOfServiceAgreementStateServiceClient = new accounts.TermsOfServiceAgreementStateServiceClient(); + const termsOfServiceServiceClient = new accounts.TermsOfServiceServiceClient(); + const userServiceClient = new accounts.UserServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..5c255fc89fb --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,116 @@ +// 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 {AccountIssueServiceClient, AccountsServiceClient, AccountTaxServiceClient, AutofeedSettingsServiceClient, BusinessIdentityServiceClient, BusinessInfoServiceClient, EmailPreferencesServiceClient, HomepageServiceClient, OnlineReturnPolicyServiceClient, ProgramsServiceClient, RegionsServiceClient, ShippingSettingsServiceClient, TermsOfServiceAgreementStateServiceClient, TermsOfServiceServiceClient, UserServiceClient} from '@google-shopping/accounts'; + +// check that the client class type name can be used +function doStuffWithAccountIssueServiceClient(client: AccountIssueServiceClient) { + client.close(); +} +function doStuffWithAccountsServiceClient(client: AccountsServiceClient) { + client.close(); +} +function doStuffWithAccountTaxServiceClient(client: AccountTaxServiceClient) { + client.close(); +} +function doStuffWithAutofeedSettingsServiceClient(client: AutofeedSettingsServiceClient) { + client.close(); +} +function doStuffWithBusinessIdentityServiceClient(client: BusinessIdentityServiceClient) { + client.close(); +} +function doStuffWithBusinessInfoServiceClient(client: BusinessInfoServiceClient) { + client.close(); +} +function doStuffWithEmailPreferencesServiceClient(client: EmailPreferencesServiceClient) { + client.close(); +} +function doStuffWithHomepageServiceClient(client: HomepageServiceClient) { + client.close(); +} +function doStuffWithOnlineReturnPolicyServiceClient(client: OnlineReturnPolicyServiceClient) { + client.close(); +} +function doStuffWithProgramsServiceClient(client: ProgramsServiceClient) { + client.close(); +} +function doStuffWithRegionsServiceClient(client: RegionsServiceClient) { + client.close(); +} +function doStuffWithShippingSettingsServiceClient(client: ShippingSettingsServiceClient) { + client.close(); +} +function doStuffWithTermsOfServiceAgreementStateServiceClient(client: TermsOfServiceAgreementStateServiceClient) { + client.close(); +} +function doStuffWithTermsOfServiceServiceClient(client: TermsOfServiceServiceClient) { + client.close(); +} +function doStuffWithUserServiceClient(client: UserServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const accountIssueServiceClient = new AccountIssueServiceClient(); + doStuffWithAccountIssueServiceClient(accountIssueServiceClient); + // check that the client instance can be created + const accountsServiceClient = new AccountsServiceClient(); + doStuffWithAccountsServiceClient(accountsServiceClient); + // check that the client instance can be created + 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 + const businessInfoServiceClient = new BusinessInfoServiceClient(); + doStuffWithBusinessInfoServiceClient(businessInfoServiceClient); + // check that the client instance can be created + const emailPreferencesServiceClient = new EmailPreferencesServiceClient(); + doStuffWithEmailPreferencesServiceClient(emailPreferencesServiceClient); + // check that the client instance can be created + const homepageServiceClient = new HomepageServiceClient(); + doStuffWithHomepageServiceClient(homepageServiceClient); + // check that the client instance can be created + const onlineReturnPolicyServiceClient = new OnlineReturnPolicyServiceClient(); + doStuffWithOnlineReturnPolicyServiceClient(onlineReturnPolicyServiceClient); + // check that the client instance can be created + const programsServiceClient = new ProgramsServiceClient(); + doStuffWithProgramsServiceClient(programsServiceClient); + // check that the client instance can be created + const regionsServiceClient = new RegionsServiceClient(); + doStuffWithRegionsServiceClient(regionsServiceClient); + // check that the client instance can be created + const shippingSettingsServiceClient = new ShippingSettingsServiceClient(); + doStuffWithShippingSettingsServiceClient(shippingSettingsServiceClient); + // check that the client instance can be created + const termsOfServiceAgreementStateServiceClient = new TermsOfServiceAgreementStateServiceClient(); + doStuffWithTermsOfServiceAgreementStateServiceClient(termsOfServiceAgreementStateServiceClient); + // check that the client instance can be created + const termsOfServiceServiceClient = new TermsOfServiceServiceClient(); + doStuffWithTermsOfServiceServiceClient(termsOfServiceServiceClient); + // check that the client instance can be created + const userServiceClient = new UserServiceClient(); + doStuffWithUserServiceClient(userServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/install.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_issue_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_issue_service_v1beta.ts new file mode 100644 index 00000000000..57ad6140c53 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_issue_service_v1beta.ts @@ -0,0 +1,1023 @@ +// 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 accountissueserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta.AccountIssueServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient(); + 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 = accountissueserviceModule.v1beta.AccountIssueServiceClient.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 = accountissueserviceModule.v1beta.AccountIssueServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({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 accountissueserviceModule.v1beta.AccountIssueServiceClient(); + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({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 accountissueserviceModule.v1beta.AccountIssueServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = accountissueserviceModule.v1beta.AccountIssueServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.accountIssueServiceStub, undefined); + await client.initialize(); + assert(client.accountIssueServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.accountIssueServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.accountIssueServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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('listAccountIssues', () => { + it('invokes listAccountIssues without error', async () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + ]; + client.innerApiCalls.listAccountIssues = stubSimpleCall(expectedResponse); + const [response] = await client.listAccountIssues(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAccountIssues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAccountIssues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAccountIssues without error using callback', async () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + ]; + client.innerApiCalls.listAccountIssues = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAccountIssues( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAccountIssues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAccountIssues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAccountIssues with error', async () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAccountIssues = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccountIssues(request), expectedError); + const actualRequest = (client.innerApiCalls.listAccountIssues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAccountIssues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAccountIssuesStream without error', async () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + ]; + client.descriptors.page.listAccountIssues.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAccountIssuesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.AccountIssue[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.AccountIssue) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAccountIssues.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccountIssues, request)); + assert( + (client.descriptors.page.listAccountIssues.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAccountIssuesStream with error', async () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAccountIssues.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAccountIssuesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.AccountIssue[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.AccountIssue) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAccountIssues.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccountIssues, request)); + assert( + (client.descriptors.page.listAccountIssues.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAccountIssues without error', async () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), + ]; + client.descriptors.page.listAccountIssues.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[] = []; + const iterable = client.listAccountIssuesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAccountIssues.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAccountIssues.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAccountIssues with error', async () => { + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAccountIssues.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAccountIssuesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAccountIssues.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAccountIssues.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_tax_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_tax_service_v1beta.ts new file mode 100644 index 00000000000..cdef353986a --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_tax_service_v1beta.ts @@ -0,0 +1,1243 @@ +// 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 accounttaxserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta.AccountTaxServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient(); + 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 = accounttaxserviceModule.v1beta.AccountTaxServiceClient.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 = accounttaxserviceModule.v1beta.AccountTaxServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({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 accounttaxserviceModule.v1beta.AccountTaxServiceClient(); + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = accounttaxserviceModule.v1beta.AccountTaxServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.accountTaxServiceStub, undefined); + await client.initialize(); + assert(client.accountTaxServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.accountTaxServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.accountTaxServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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('getAccountTax', () => { + it('invokes getAccountTax without error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AccountTax() + ); + client.innerApiCalls.getAccountTax = stubSimpleCall(expectedResponse); + const [response] = await client.getAccountTax(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAccountTax as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccountTax as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccountTax without error using callback', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AccountTax() + ); + client.innerApiCalls.getAccountTax = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAccountTax( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccountTax|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAccountTax as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccountTax as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccountTax with error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAccountTax = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAccountTax(request), expectedError); + const actualRequest = (client.innerApiCalls.getAccountTax as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccountTax as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccountTax with closed client', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAccountTax(request), expectedError); + }); + }); + + describe('updateAccountTax', () => { + it('invokes updateAccountTax without error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest() + ); + request.accountTax ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest', ['accountTax', 'name']); + request.accountTax.name = defaultValue1; + const expectedHeaderRequestParams = `account_tax.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AccountTax() + ); + client.innerApiCalls.updateAccountTax = stubSimpleCall(expectedResponse); + const [response] = await client.updateAccountTax(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAccountTax as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccountTax as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccountTax without error using callback', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest() + ); + request.accountTax ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest', ['accountTax', 'name']); + request.accountTax.name = defaultValue1; + const expectedHeaderRequestParams = `account_tax.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AccountTax() + ); + client.innerApiCalls.updateAccountTax = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAccountTax( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccountTax|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAccountTax as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccountTax as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccountTax with error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest() + ); + request.accountTax ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest', ['accountTax', 'name']); + request.accountTax.name = defaultValue1; + const expectedHeaderRequestParams = `account_tax.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAccountTax = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAccountTax(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAccountTax as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccountTax as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccountTax with closed client', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest() + ); + request.accountTax ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest', ['accountTax', 'name']); + request.accountTax.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAccountTax(request), expectedError); + }); + }); + + describe('listAccountTax', () => { + it('invokes listAccountTax without error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + ]; + client.innerApiCalls.listAccountTax = stubSimpleCall(expectedResponse); + const [response] = await client.listAccountTax(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAccountTax as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAccountTax as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAccountTax without error using callback', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + ]; + client.innerApiCalls.listAccountTax = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAccountTax( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccountTax[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAccountTax as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAccountTax as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAccountTax with error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAccountTax = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccountTax(request), expectedError); + const actualRequest = (client.innerApiCalls.listAccountTax as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAccountTax as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAccountTaxStream without error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + ]; + client.descriptors.page.listAccountTax.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAccountTaxStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.AccountTax[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.AccountTax) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAccountTax.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccountTax, request)); + assert( + (client.descriptors.page.listAccountTax.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAccountTaxStream with error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAccountTax.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAccountTaxStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.AccountTax[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.AccountTax) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAccountTax.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccountTax, request)); + assert( + (client.descriptors.page.listAccountTax.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAccountTax without error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), + ]; + client.descriptors.page.listAccountTax.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.shopping.merchant.accounts.v1beta.IAccountTax[] = []; + const iterable = client.listAccountTaxAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAccountTax.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAccountTax.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAccountTax with error', async () => { + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAccountTax.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAccountTaxAsync(request); + await assert.rejects(async () => { + const responses: protos.google.shopping.merchant.accounts.v1beta.IAccountTax[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAccountTax.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAccountTax.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_accounts_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_accounts_service_v1beta.ts new file mode 100644 index 00000000000..6adc8ca6d78 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_accounts_service_v1beta.ts @@ -0,0 +1,1601 @@ +// 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 accountsserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta.AccountsServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient(); + 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 = accountsserviceModule.v1beta.AccountsServiceClient.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 = accountsserviceModule.v1beta.AccountsServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({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 accountsserviceModule.v1beta.AccountsServiceClient(); + 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 accountsserviceModule.v1beta.AccountsServiceClient({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 accountsserviceModule.v1beta.AccountsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = accountsserviceModule.v1beta.AccountsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.accountsServiceStub, undefined); + await client.initialize(); + assert(client.accountsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.accountsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.accountsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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('getAccount', () => { + it('invokes getAccount without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Account() + ); + client.innerApiCalls.getAccount = stubSimpleCall(expectedResponse); + const [response] = await client.getAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccount without error using callback', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Account() + ); + client.innerApiCalls.getAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAccount( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccount with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAccount(request), expectedError); + const actualRequest = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAccount with closed client', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAccount(request), expectedError); + }); + }); + + describe('createAndConfigureAccount', () => { + it('invokes createAndConfigureAccount without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Account() + ); + client.innerApiCalls.createAndConfigureAccount = stubSimpleCall(expectedResponse); + const [response] = await client.createAndConfigureAccount(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createAndConfigureAccount without error using callback', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Account() + ); + client.innerApiCalls.createAndConfigureAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAndConfigureAccount( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createAndConfigureAccount with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createAndConfigureAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAndConfigureAccount(request), expectedError); + }); + + it('invokes createAndConfigureAccount with closed client', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAndConfigureAccount(request), expectedError); + }); + }); + + describe('deleteAccount', () => { + it('invokes deleteAccount without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAccount = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAccount without error using callback', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAccount( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAccount with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAccount(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAccount with closed client', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAccount(request), expectedError); + }); + }); + + describe('updateAccount', () => { + it('invokes updateAccount without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest() + ); + request.account ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Account() + ); + client.innerApiCalls.updateAccount = stubSimpleCall(expectedResponse); + const [response] = await client.updateAccount(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccount without error using callback', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest() + ); + request.account ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Account() + ); + client.innerApiCalls.updateAccount = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAccount( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccount with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest() + ); + request.account ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAccount = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAccount(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAccount with closed client', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest() + ); + request.account ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest', ['account', 'name']); + request.account.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAccount(request), expectedError); + }); + }); + + describe('listAccounts', () => { + it('invokes listAccounts without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + ]; + client.innerApiCalls.listAccounts = stubSimpleCall(expectedResponse); + const [response] = await client.listAccounts(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listAccounts without error using callback', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() + );const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + ]; + client.innerApiCalls.listAccounts = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAccounts( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listAccounts with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listAccounts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAccounts(request), expectedError); + }); + + it('invokes listAccountsStream without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + ]; + client.descriptors.page.listAccounts.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAccountsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.Account[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Account) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAccounts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccounts, request)); + }); + + it('invokes listAccountsStream with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listAccounts.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAccountsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.Account[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Account) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAccounts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAccounts, request)); + }); + + it('uses async iteration with listAccounts without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + ]; + client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.shopping.merchant.accounts.v1beta.IAccount[] = []; + const iterable = client.listAccountsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAccounts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + + it('uses async iteration with listAccounts with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAccountsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.shopping.merchant.accounts.v1beta.IAccount[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAccounts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('listSubAccounts', () => { + it('invokes listSubAccounts without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); + request.provider = defaultValue1; + const expectedHeaderRequestParams = `provider=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + ]; + client.innerApiCalls.listSubAccounts = stubSimpleCall(expectedResponse); + const [response] = await client.listSubAccounts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSubAccounts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSubAccounts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubAccounts without error using callback', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); + request.provider = defaultValue1; + const expectedHeaderRequestParams = `provider=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + ]; + client.innerApiCalls.listSubAccounts = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSubAccounts( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSubAccounts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSubAccounts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubAccounts with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); + request.provider = defaultValue1; + const expectedHeaderRequestParams = `provider=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSubAccounts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSubAccounts(request), expectedError); + const actualRequest = (client.innerApiCalls.listSubAccounts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSubAccounts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubAccountsStream without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); + request.provider = defaultValue1; + const expectedHeaderRequestParams = `provider=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + ]; + client.descriptors.page.listSubAccounts.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSubAccountsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.Account[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Account) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSubAccounts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSubAccounts, request)); + assert( + (client.descriptors.page.listSubAccounts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSubAccountsStream with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); + request.provider = defaultValue1; + const expectedHeaderRequestParams = `provider=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubAccounts.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSubAccountsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.Account[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Account) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSubAccounts.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSubAccounts, request)); + assert( + (client.descriptors.page.listSubAccounts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSubAccounts without error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); + request.provider = defaultValue1; + const expectedHeaderRequestParams = `provider=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), + ]; + client.descriptors.page.listSubAccounts.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.shopping.merchant.accounts.v1beta.IAccount[] = []; + const iterable = client.listSubAccountsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSubAccounts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSubAccounts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSubAccounts with error', async () => { + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); + request.provider = defaultValue1; + const expectedHeaderRequestParams = `provider=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubAccounts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSubAccountsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.shopping.merchant.accounts.v1beta.IAccount[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSubAccounts.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSubAccounts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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 accountsserviceModule.v1beta.AccountsServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_autofeed_settings_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_autofeed_settings_service_v1beta.ts new file mode 100644 index 00000000000..e049d0f6278 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_autofeed_settings_service_v1beta.ts @@ -0,0 +1,951 @@ +// 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_identity_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_identity_service_v1beta.ts new file mode 100644 index 00000000000..32b06cd929f --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_identity_service_v1beta.ts @@ -0,0 +1,951 @@ +// 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 businessidentityserviceModule 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.BusinessIdentityServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient(); + 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 = businessidentityserviceModule.v1beta.BusinessIdentityServiceClient.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 = businessidentityserviceModule.v1beta.BusinessIdentityServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient(); + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = businessidentityserviceModule.v1beta.BusinessIdentityServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.businessIdentityServiceStub, undefined); + await client.initialize(); + assert(client.businessIdentityServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.businessIdentityServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.businessIdentityServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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('getBusinessIdentity', () => { + it('invokes getBusinessIdentity without error', async () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.BusinessIdentity() + ); + client.innerApiCalls.getBusinessIdentity = stubSimpleCall(expectedResponse); + const [response] = await client.getBusinessIdentity(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBusinessIdentity as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBusinessIdentity as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBusinessIdentity without error using callback', async () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.BusinessIdentity() + ); + client.innerApiCalls.getBusinessIdentity = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBusinessIdentity( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBusinessIdentity as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBusinessIdentity as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBusinessIdentity with error', async () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBusinessIdentity = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBusinessIdentity(request), expectedError); + const actualRequest = (client.innerApiCalls.getBusinessIdentity as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBusinessIdentity as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBusinessIdentity with closed client', async () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBusinessIdentity(request), expectedError); + }); + }); + + describe('updateBusinessIdentity', () => { + it('invokes updateBusinessIdentity without error', async () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest() + ); + request.businessIdentity ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest', ['businessIdentity', 'name']); + request.businessIdentity.name = defaultValue1; + const expectedHeaderRequestParams = `business_identity.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.BusinessIdentity() + ); + client.innerApiCalls.updateBusinessIdentity = stubSimpleCall(expectedResponse); + const [response] = await client.updateBusinessIdentity(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBusinessIdentity as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessIdentity as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBusinessIdentity without error using callback', async () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest() + ); + request.businessIdentity ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest', ['businessIdentity', 'name']); + request.businessIdentity.name = defaultValue1; + const expectedHeaderRequestParams = `business_identity.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.BusinessIdentity() + ); + client.innerApiCalls.updateBusinessIdentity = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBusinessIdentity( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBusinessIdentity as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessIdentity as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBusinessIdentity with error', async () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest() + ); + request.businessIdentity ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest', ['businessIdentity', 'name']); + request.businessIdentity.name = defaultValue1; + const expectedHeaderRequestParams = `business_identity.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBusinessIdentity = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateBusinessIdentity(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBusinessIdentity as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessIdentity as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBusinessIdentity with closed client', async () => { + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest() + ); + request.businessIdentity ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest', ['businessIdentity', 'name']); + request.businessIdentity.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateBusinessIdentity(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_info_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_info_service_v1beta.ts new file mode 100644 index 00000000000..a4fe976b079 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_info_service_v1beta.ts @@ -0,0 +1,951 @@ +// 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 businessinfoserviceModule 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.BusinessInfoServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient(); + 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 = businessinfoserviceModule.v1beta.BusinessInfoServiceClient.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 = businessinfoserviceModule.v1beta.BusinessInfoServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient(); + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = businessinfoserviceModule.v1beta.BusinessInfoServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.businessInfoServiceStub, undefined); + await client.initialize(); + assert(client.businessInfoServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.businessInfoServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.businessInfoServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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('getBusinessInfo', () => { + it('invokes getBusinessInfo without error', async () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.BusinessInfo() + ); + client.innerApiCalls.getBusinessInfo = stubSimpleCall(expectedResponse); + const [response] = await client.getBusinessInfo(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBusinessInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBusinessInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBusinessInfo without error using callback', async () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.BusinessInfo() + ); + client.innerApiCalls.getBusinessInfo = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBusinessInfo( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBusinessInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBusinessInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBusinessInfo with error', async () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBusinessInfo = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBusinessInfo(request), expectedError); + const actualRequest = (client.innerApiCalls.getBusinessInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBusinessInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBusinessInfo with closed client', async () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBusinessInfo(request), expectedError); + }); + }); + + describe('updateBusinessInfo', () => { + it('invokes updateBusinessInfo without error', async () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest() + ); + request.businessInfo ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest', ['businessInfo', 'name']); + request.businessInfo.name = defaultValue1; + const expectedHeaderRequestParams = `business_info.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.BusinessInfo() + ); + client.innerApiCalls.updateBusinessInfo = stubSimpleCall(expectedResponse); + const [response] = await client.updateBusinessInfo(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBusinessInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBusinessInfo without error using callback', async () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest() + ); + request.businessInfo ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest', ['businessInfo', 'name']); + request.businessInfo.name = defaultValue1; + const expectedHeaderRequestParams = `business_info.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.BusinessInfo() + ); + client.innerApiCalls.updateBusinessInfo = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBusinessInfo( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBusinessInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBusinessInfo with error', async () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest() + ); + request.businessInfo ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest', ['businessInfo', 'name']); + request.businessInfo.name = defaultValue1; + const expectedHeaderRequestParams = `business_info.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBusinessInfo = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateBusinessInfo(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBusinessInfo as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessInfo as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBusinessInfo with closed client', async () => { + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest() + ); + request.businessInfo ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest', ['businessInfo', 'name']); + request.businessInfo.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateBusinessInfo(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_email_preferences_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_email_preferences_service_v1beta.ts new file mode 100644 index 00000000000..2818ed6646c --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_email_preferences_service_v1beta.ts @@ -0,0 +1,951 @@ +// 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 emailpreferencesserviceModule 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.EmailPreferencesServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient(); + 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 = emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient.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 = emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient(); + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.emailPreferencesServiceStub, undefined); + await client.initialize(); + assert(client.emailPreferencesServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.emailPreferencesServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.emailPreferencesServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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('getEmailPreferences', () => { + it('invokes getEmailPreferences without error', async () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.EmailPreferences() + ); + client.innerApiCalls.getEmailPreferences = stubSimpleCall(expectedResponse); + const [response] = await client.getEmailPreferences(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEmailPreferences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEmailPreferences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEmailPreferences without error using callback', async () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.EmailPreferences() + ); + client.innerApiCalls.getEmailPreferences = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEmailPreferences( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEmailPreferences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEmailPreferences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEmailPreferences with error', async () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEmailPreferences = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEmailPreferences(request), expectedError); + const actualRequest = (client.innerApiCalls.getEmailPreferences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEmailPreferences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEmailPreferences with closed client', async () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEmailPreferences(request), expectedError); + }); + }); + + describe('updateEmailPreferences', () => { + it('invokes updateEmailPreferences without error', async () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest() + ); + request.emailPreferences ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest', ['emailPreferences', 'name']); + request.emailPreferences.name = defaultValue1; + const expectedHeaderRequestParams = `email_preferences.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.EmailPreferences() + ); + client.innerApiCalls.updateEmailPreferences = stubSimpleCall(expectedResponse); + const [response] = await client.updateEmailPreferences(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEmailPreferences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEmailPreferences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEmailPreferences without error using callback', async () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest() + ); + request.emailPreferences ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest', ['emailPreferences', 'name']); + request.emailPreferences.name = defaultValue1; + const expectedHeaderRequestParams = `email_preferences.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.EmailPreferences() + ); + client.innerApiCalls.updateEmailPreferences = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEmailPreferences( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEmailPreferences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEmailPreferences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEmailPreferences with error', async () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest() + ); + request.emailPreferences ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest', ['emailPreferences', 'name']); + request.emailPreferences.name = defaultValue1; + const expectedHeaderRequestParams = `email_preferences.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEmailPreferences = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEmailPreferences(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEmailPreferences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEmailPreferences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEmailPreferences with closed client', async () => { + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest() + ); + request.emailPreferences ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest', ['emailPreferences', 'name']); + request.emailPreferences.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateEmailPreferences(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_homepage_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_homepage_service_v1beta.ts new file mode 100644 index 00000000000..683a2dd144f --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_homepage_service_v1beta.ts @@ -0,0 +1,1167 @@ +// 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 homepageserviceModule 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.HomepageServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient(); + 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 = homepageserviceModule.v1beta.HomepageServiceClient.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 = homepageserviceModule.v1beta.HomepageServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({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 homepageserviceModule.v1beta.HomepageServiceClient(); + 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 homepageserviceModule.v1beta.HomepageServiceClient({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 homepageserviceModule.v1beta.HomepageServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = homepageserviceModule.v1beta.HomepageServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.homepageServiceStub, undefined); + await client.initialize(); + assert(client.homepageServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.homepageServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.homepageServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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('getHomepage', () => { + it('invokes getHomepage without error', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Homepage() + ); + client.innerApiCalls.getHomepage = stubSimpleCall(expectedResponse); + const [response] = await client.getHomepage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHomepage without error using callback', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Homepage() + ); + client.innerApiCalls.getHomepage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHomepage( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IHomepage|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHomepage with error', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getHomepage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHomepage(request), expectedError); + const actualRequest = (client.innerApiCalls.getHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHomepage with closed client', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getHomepage(request), expectedError); + }); + }); + + describe('updateHomepage', () => { + it('invokes updateHomepage without error', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest() + ); + request.homepage ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest', ['homepage', 'name']); + request.homepage.name = defaultValue1; + const expectedHeaderRequestParams = `homepage.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Homepage() + ); + client.innerApiCalls.updateHomepage = stubSimpleCall(expectedResponse); + const [response] = await client.updateHomepage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateHomepage without error using callback', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest() + ); + request.homepage ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest', ['homepage', 'name']); + request.homepage.name = defaultValue1; + const expectedHeaderRequestParams = `homepage.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Homepage() + ); + client.innerApiCalls.updateHomepage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateHomepage( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IHomepage|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateHomepage with error', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest() + ); + request.homepage ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest', ['homepage', 'name']); + request.homepage.name = defaultValue1; + const expectedHeaderRequestParams = `homepage.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateHomepage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateHomepage(request), expectedError); + const actualRequest = (client.innerApiCalls.updateHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateHomepage with closed client', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest() + ); + request.homepage ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest', ['homepage', 'name']); + request.homepage.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateHomepage(request), expectedError); + }); + }); + + describe('claimHomepage', () => { + it('invokes claimHomepage without error', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Homepage() + ); + client.innerApiCalls.claimHomepage = stubSimpleCall(expectedResponse); + const [response] = await client.claimHomepage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.claimHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.claimHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes claimHomepage without error using callback', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Homepage() + ); + client.innerApiCalls.claimHomepage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.claimHomepage( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IHomepage|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.claimHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.claimHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes claimHomepage with error', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.claimHomepage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.claimHomepage(request), expectedError); + const actualRequest = (client.innerApiCalls.claimHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.claimHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes claimHomepage with closed client', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.claimHomepage(request), expectedError); + }); + }); + + describe('unclaimHomepage', () => { + it('invokes unclaimHomepage without error', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Homepage() + ); + client.innerApiCalls.unclaimHomepage = stubSimpleCall(expectedResponse); + const [response] = await client.unclaimHomepage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.unclaimHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.unclaimHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes unclaimHomepage without error using callback', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Homepage() + ); + client.innerApiCalls.unclaimHomepage = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.unclaimHomepage( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IHomepage|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.unclaimHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.unclaimHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes unclaimHomepage with error', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.unclaimHomepage = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.unclaimHomepage(request), expectedError); + const actualRequest = (client.innerApiCalls.unclaimHomepage as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.unclaimHomepage as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes unclaimHomepage with closed client', async () => { + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.unclaimHomepage(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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 homepageserviceModule.v1beta.HomepageServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_online_return_policy_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_online_return_policy_service_v1beta.ts new file mode 100644 index 00000000000..bf40038d9a7 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_online_return_policy_service_v1beta.ts @@ -0,0 +1,1131 @@ +// 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 onlinereturnpolicyserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta.OnlineReturnPolicyServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient(); + 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 = onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient.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 = onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient(); + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.onlineReturnPolicyServiceStub, undefined); + await client.initialize(); + assert(client.onlineReturnPolicyServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.onlineReturnPolicyServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.onlineReturnPolicyServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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('getOnlineReturnPolicy', () => { + it('invokes getOnlineReturnPolicy without error', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy() + ); + client.innerApiCalls.getOnlineReturnPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getOnlineReturnPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOnlineReturnPolicy without error using callback', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy() + ); + client.innerApiCalls.getOnlineReturnPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getOnlineReturnPolicy( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOnlineReturnPolicy with error', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getOnlineReturnPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getOnlineReturnPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getOnlineReturnPolicy with closed client', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getOnlineReturnPolicy(request), expectedError); + }); + }); + + describe('listOnlineReturnPolicies', () => { + it('invokes listOnlineReturnPolicies without error', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + ]; + client.innerApiCalls.listOnlineReturnPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.listOnlineReturnPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOnlineReturnPolicies without error using callback', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + ]; + client.innerApiCalls.listOnlineReturnPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listOnlineReturnPolicies( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOnlineReturnPolicies with error', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOnlineReturnPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listOnlineReturnPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listOnlineReturnPoliciesStream without error', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + ]; + client.descriptors.page.listOnlineReturnPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listOnlineReturnPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listOnlineReturnPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listOnlineReturnPolicies, request)); + assert( + (client.descriptors.page.listOnlineReturnPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listOnlineReturnPoliciesStream with error', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOnlineReturnPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listOnlineReturnPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listOnlineReturnPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listOnlineReturnPolicies, request)); + assert( + (client.descriptors.page.listOnlineReturnPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOnlineReturnPolicies without error', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), + ]; + client.descriptors.page.listOnlineReturnPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[] = []; + const iterable = client.listOnlineReturnPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listOnlineReturnPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listOnlineReturnPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listOnlineReturnPolicies with error', async () => { + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listOnlineReturnPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listOnlineReturnPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listOnlineReturnPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listOnlineReturnPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_programs_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_programs_service_v1beta.ts new file mode 100644 index 00000000000..1eb5089ebeb --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_programs_service_v1beta.ts @@ -0,0 +1,1347 @@ +// 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 programsserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta.ProgramsServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient(); + 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 = programsserviceModule.v1beta.ProgramsServiceClient.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 = programsserviceModule.v1beta.ProgramsServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({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 programsserviceModule.v1beta.ProgramsServiceClient(); + 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 programsserviceModule.v1beta.ProgramsServiceClient({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 programsserviceModule.v1beta.ProgramsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = programsserviceModule.v1beta.ProgramsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.programsServiceStub, undefined); + await client.initialize(); + assert(client.programsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.programsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.programsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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('getProgram', () => { + it('invokes getProgram without error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetProgramRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Program() + ); + client.innerApiCalls.getProgram = stubSimpleCall(expectedResponse); + const [response] = await client.getProgram(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProgram as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProgram as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProgram without error using callback', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetProgramRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Program() + ); + client.innerApiCalls.getProgram = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProgram( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IProgram|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProgram as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProgram as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProgram with error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetProgramRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProgram = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProgram(request), expectedError); + const actualRequest = (client.innerApiCalls.getProgram as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProgram as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProgram with closed client', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetProgramRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getProgram(request), expectedError); + }); + }); + + describe('enableProgram', () => { + it('invokes enableProgram without error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.EnableProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.EnableProgramRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Program() + ); + client.innerApiCalls.enableProgram = stubSimpleCall(expectedResponse); + const [response] = await client.enableProgram(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.enableProgram as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProgram as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableProgram without error using callback', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.EnableProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.EnableProgramRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Program() + ); + client.innerApiCalls.enableProgram = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enableProgram( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IProgram|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.enableProgram as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProgram as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableProgram with error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.EnableProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.EnableProgramRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableProgram = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.enableProgram(request), expectedError); + const actualRequest = (client.innerApiCalls.enableProgram as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProgram as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableProgram with closed client', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.EnableProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.EnableProgramRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.enableProgram(request), expectedError); + }); + }); + + describe('disableProgram', () => { + it('invokes disableProgram without error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DisableProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DisableProgramRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Program() + ); + client.innerApiCalls.disableProgram = stubSimpleCall(expectedResponse); + const [response] = await client.disableProgram(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disableProgram as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProgram as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableProgram without error using callback', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DisableProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DisableProgramRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Program() + ); + client.innerApiCalls.disableProgram = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disableProgram( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IProgram|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disableProgram as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProgram as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableProgram with error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DisableProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DisableProgramRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableProgram = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.disableProgram(request), expectedError); + const actualRequest = (client.innerApiCalls.disableProgram as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProgram as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableProgram with closed client', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DisableProgramRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DisableProgramRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.disableProgram(request), expectedError); + }); + }); + + describe('listPrograms', () => { + it('invokes listPrograms without error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + ]; + client.innerApiCalls.listPrograms = stubSimpleCall(expectedResponse); + const [response] = await client.listPrograms(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPrograms as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPrograms as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrograms without error using callback', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + ]; + client.innerApiCalls.listPrograms = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPrograms( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IProgram[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listPrograms as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPrograms as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrograms with error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPrograms = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPrograms(request), expectedError); + const actualRequest = (client.innerApiCalls.listPrograms as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPrograms as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProgramsStream without error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + ]; + client.descriptors.page.listPrograms.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listProgramsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.Program[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Program) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listPrograms.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPrograms, request)); + assert( + (client.descriptors.page.listPrograms.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listProgramsStream with error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrograms.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listProgramsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.Program[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Program) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listPrograms.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listPrograms, request)); + assert( + (client.descriptors.page.listPrograms.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrograms without error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), + ]; + client.descriptors.page.listPrograms.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.shopping.merchant.accounts.v1beta.IProgram[] = []; + const iterable = client.listProgramsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listPrograms.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPrograms.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrograms with error', async () => { + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrograms.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProgramsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.shopping.merchant.accounts.v1beta.IProgram[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listPrograms.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listPrograms.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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 programsserviceModule.v1beta.ProgramsServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_regions_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_regions_service_v1beta.ts new file mode 100644 index 00000000000..38211d15987 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_regions_service_v1beta.ts @@ -0,0 +1,1459 @@ +// 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 regionsserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta.RegionsServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient(); + 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 = regionsserviceModule.v1beta.RegionsServiceClient.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 = regionsserviceModule.v1beta.RegionsServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({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 regionsserviceModule.v1beta.RegionsServiceClient(); + 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 regionsserviceModule.v1beta.RegionsServiceClient({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 regionsserviceModule.v1beta.RegionsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = regionsserviceModule.v1beta.RegionsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.regionsServiceStub, undefined); + await client.initialize(); + assert(client.regionsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.regionsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.regionsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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('getRegion', () => { + it('invokes getRegion without error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetRegionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Region() + ); + client.innerApiCalls.getRegion = stubSimpleCall(expectedResponse); + const [response] = await client.getRegion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRegion without error using callback', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetRegionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Region() + ); + client.innerApiCalls.getRegion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRegion( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IRegion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRegion with error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetRegionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRegion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRegion(request), expectedError); + const actualRequest = (client.innerApiCalls.getRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRegion with closed client', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetRegionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRegion(request), expectedError); + }); + }); + + describe('createRegion', () => { + it('invokes createRegion without error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateRegionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Region() + ); + client.innerApiCalls.createRegion = stubSimpleCall(expectedResponse); + const [response] = await client.createRegion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRegion without error using callback', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateRegionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Region() + ); + client.innerApiCalls.createRegion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRegion( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IRegion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRegion with error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateRegionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRegion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createRegion(request), expectedError); + const actualRequest = (client.innerApiCalls.createRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRegion with closed client', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateRegionRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createRegion(request), expectedError); + }); + }); + + describe('updateRegion', () => { + it('invokes updateRegion without error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest() + ); + request.region ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest', ['region', 'name']); + request.region.name = defaultValue1; + const expectedHeaderRequestParams = `region.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Region() + ); + client.innerApiCalls.updateRegion = stubSimpleCall(expectedResponse); + const [response] = await client.updateRegion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRegion without error using callback', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest() + ); + request.region ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest', ['region', 'name']); + request.region.name = defaultValue1; + const expectedHeaderRequestParams = `region.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.Region() + ); + client.innerApiCalls.updateRegion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRegion( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IRegion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRegion with error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest() + ); + request.region ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest', ['region', 'name']); + request.region.name = defaultValue1; + const expectedHeaderRequestParams = `region.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRegion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateRegion(request), expectedError); + const actualRequest = (client.innerApiCalls.updateRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRegion with closed client', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest() + ); + request.region ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest', ['region', 'name']); + request.region.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateRegion(request), expectedError); + }); + }); + + describe('deleteRegion', () => { + it('invokes deleteRegion without error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRegion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteRegion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRegion without error using callback', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteRegion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRegion( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRegion with error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRegion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteRegion(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteRegion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteRegion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRegion with closed client', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteRegion(request), expectedError); + }); + }); + + describe('listRegions', () => { + it('invokes listRegions without error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + ]; + client.innerApiCalls.listRegions = stubSimpleCall(expectedResponse); + const [response] = await client.listRegions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRegions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRegions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRegions without error using callback', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + ]; + client.innerApiCalls.listRegions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRegions( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IRegion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listRegions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRegions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRegions with error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRegions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listRegions(request), expectedError); + const actualRequest = (client.innerApiCalls.listRegions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listRegions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRegionsStream without error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + ]; + client.descriptors.page.listRegions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listRegionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.Region[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Region) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listRegions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRegions, request)); + assert( + (client.descriptors.page.listRegions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRegionsStream with error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRegions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listRegionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.Region[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Region) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listRegions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRegions, request)); + assert( + (client.descriptors.page.listRegions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRegions without error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), + ]; + client.descriptors.page.listRegions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.shopping.merchant.accounts.v1beta.IRegion[] = []; + const iterable = client.listRegionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRegions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRegions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRegions with error', async () => { + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRegions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRegionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.shopping.merchant.accounts.v1beta.IRegion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRegions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listRegions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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 regionsserviceModule.v1beta.RegionsServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_shipping_settings_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_shipping_settings_service_v1beta.ts new file mode 100644 index 00000000000..d63a605f56d --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_shipping_settings_service_v1beta.ts @@ -0,0 +1,947 @@ +// 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 shippingsettingsserviceModule 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.ShippingSettingsServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient(); + 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 = shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient.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 = shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient(); + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.shippingSettingsServiceStub, undefined); + await client.initialize(); + assert(client.shippingSettingsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.shippingSettingsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.shippingSettingsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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('getShippingSettings', () => { + it('invokes getShippingSettings without error', async () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ShippingSettings() + ); + client.innerApiCalls.getShippingSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getShippingSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getShippingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getShippingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getShippingSettings without error using callback', async () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ShippingSettings() + ); + client.innerApiCalls.getShippingSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getShippingSettings( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IShippingSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getShippingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getShippingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getShippingSettings with error', async () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getShippingSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getShippingSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.getShippingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getShippingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getShippingSettings with closed client', async () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getShippingSettings(request), expectedError); + }); + }); + + describe('insertShippingSettings', () => { + it('invokes insertShippingSettings without error', async () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ShippingSettings() + ); + client.innerApiCalls.insertShippingSettings = stubSimpleCall(expectedResponse); + const [response] = await client.insertShippingSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.insertShippingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.insertShippingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertShippingSettings without error using callback', async () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ShippingSettings() + ); + client.innerApiCalls.insertShippingSettings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insertShippingSettings( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IShippingSettings|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.insertShippingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.insertShippingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertShippingSettings with error', async () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.insertShippingSettings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insertShippingSettings(request), expectedError); + const actualRequest = (client.innerApiCalls.insertShippingSettings as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.insertShippingSettings as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes insertShippingSettings with closed client', async () => { + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.insertShippingSettings(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_agreement_state_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_agreement_state_service_v1beta.ts new file mode 100644 index 00000000000..e7a033e5184 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_agreement_state_service_v1beta.ts @@ -0,0 +1,947 @@ +// 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 termsofserviceagreementstateserviceModule 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.TermsOfServiceAgreementStateServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient(); + 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 = termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient.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 = termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient(); + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.termsOfServiceAgreementStateServiceStub, undefined); + await client.initialize(); + assert(client.termsOfServiceAgreementStateServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.termsOfServiceAgreementStateServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.termsOfServiceAgreementStateServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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('getTermsOfServiceAgreementState', () => { + it('invokes getTermsOfServiceAgreementState without error', async () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState() + ); + client.innerApiCalls.getTermsOfServiceAgreementState = stubSimpleCall(expectedResponse); + const [response] = await client.getTermsOfServiceAgreementState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTermsOfServiceAgreementState without error using callback', async () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState() + ); + client.innerApiCalls.getTermsOfServiceAgreementState = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTermsOfServiceAgreementState( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTermsOfServiceAgreementState with error', async () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTermsOfServiceAgreementState = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTermsOfServiceAgreementState(request), expectedError); + const actualRequest = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTermsOfServiceAgreementState with closed client', async () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTermsOfServiceAgreementState(request), expectedError); + }); + }); + + describe('retrieveForApplicationTermsOfServiceAgreementState', () => { + it('invokes retrieveForApplicationTermsOfServiceAgreementState without error', async () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState() + ); + client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState = stubSimpleCall(expectedResponse); + const [response] = await client.retrieveForApplicationTermsOfServiceAgreementState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveForApplicationTermsOfServiceAgreementState without error using callback', async () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState() + ); + client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retrieveForApplicationTermsOfServiceAgreementState( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveForApplicationTermsOfServiceAgreementState with error', async () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.retrieveForApplicationTermsOfServiceAgreementState(request), expectedError); + const actualRequest = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveForApplicationTermsOfServiceAgreementState with closed client', async () => { + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.retrieveForApplicationTermsOfServiceAgreementState(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_service_v1beta.ts new file mode 100644 index 00000000000..048d0787f4d --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_service_v1beta.ts @@ -0,0 +1,1022 @@ +// 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 termsofserviceserviceModule 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.TermsOfServiceServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient(); + 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 = termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient.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 = termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient(); + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.termsOfServiceServiceStub, undefined); + await client.initialize(); + assert(client.termsOfServiceServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.termsOfServiceServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.termsOfServiceServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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('getTermsOfService', () => { + it('invokes getTermsOfService without error', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.TermsOfService() + ); + client.innerApiCalls.getTermsOfService = stubSimpleCall(expectedResponse); + const [response] = await client.getTermsOfService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTermsOfService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTermsOfService without error using callback', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.TermsOfService() + ); + client.innerApiCalls.getTermsOfService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTermsOfService( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.ITermsOfService|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getTermsOfService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTermsOfService with error', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTermsOfService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTermsOfService(request), expectedError); + const actualRequest = (client.innerApiCalls.getTermsOfService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTermsOfService with closed client', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTermsOfService(request), expectedError); + }); + }); + + describe('retrieveLatestTermsOfService', () => { + it('invokes retrieveLatestTermsOfService without error', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.TermsOfService() + ); + client.innerApiCalls.retrieveLatestTermsOfService = stubSimpleCall(expectedResponse); + const [response] = await client.retrieveLatestTermsOfService(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes retrieveLatestTermsOfService without error using callback', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.TermsOfService() + ); + client.innerApiCalls.retrieveLatestTermsOfService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retrieveLatestTermsOfService( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.ITermsOfService|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes retrieveLatestTermsOfService with error', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.retrieveLatestTermsOfService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.retrieveLatestTermsOfService(request), expectedError); + }); + + it('invokes retrieveLatestTermsOfService with closed client', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.retrieveLatestTermsOfService(request), expectedError); + }); + }); + + describe('acceptTermsOfService', () => { + it('invokes acceptTermsOfService without error', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.acceptTermsOfService = stubSimpleCall(expectedResponse); + const [response] = await client.acceptTermsOfService(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.acceptTermsOfService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acceptTermsOfService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acceptTermsOfService without error using callback', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.acceptTermsOfService = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.acceptTermsOfService( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.acceptTermsOfService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acceptTermsOfService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acceptTermsOfService with error', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.acceptTermsOfService = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.acceptTermsOfService(request), expectedError); + const actualRequest = (client.innerApiCalls.acceptTermsOfService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.acceptTermsOfService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acceptTermsOfService with closed client', async () => { + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.acceptTermsOfService(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_user_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_user_service_v1beta.ts new file mode 100644 index 00000000000..f85b8226471 --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_user_service_v1beta.ts @@ -0,0 +1,1459 @@ +// 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 userserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta.UserServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new userserviceModule.v1beta.UserServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new userserviceModule.v1beta.UserServiceClient(); + 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 = userserviceModule.v1beta.UserServiceClient.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 = userserviceModule.v1beta.UserServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new userserviceModule.v1beta.UserServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'merchantapi.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new userserviceModule.v1beta.UserServiceClient({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 userserviceModule.v1beta.UserServiceClient(); + 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 userserviceModule.v1beta.UserServiceClient({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 userserviceModule.v1beta.UserServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = userserviceModule.v1beta.UserServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new userserviceModule.v1beta.UserServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userServiceStub, undefined); + await client.initialize(); + assert(client.userServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.userServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.userServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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('getUser', () => { + it('invokes getUser without error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.User() + ); + client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); + const [response] = await client.getUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser without error using callback', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.User() + ); + client.innerApiCalls.getUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getUser( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUser(request), expectedError); + const actualRequest = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getUser with closed client', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.GetUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetUserRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getUser(request), expectedError); + }); + }); + + describe('createUser', () => { + it('invokes createUser without error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.User() + ); + client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); + const [response] = await client.createUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser without error using callback', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.User() + ); + client.innerApiCalls.createUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUser( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser with error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createUser(request), expectedError); + const actualRequest = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUser with closed client', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.CreateUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateUserRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createUser(request), expectedError); + }); + }); + + describe('deleteUser', () => { + it('invokes deleteUser without error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); + const [response] = await client.deleteUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser without error using callback', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUser( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser with error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteUser(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUser with closed client', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.DeleteUserRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteUserRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteUser(request), expectedError); + }); + }); + + describe('updateUser', () => { + it('invokes updateUser without error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.User() + ); + client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); + const [response] = await client.updateUser(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser without error using callback', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.User() + ); + client.innerApiCalls.updateUser = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateUser( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IUser|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser with error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateUser(request), expectedError); + const actualRequest = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUser with closed client', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.UpdateUserRequest() + ); + request.user ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateUserRequest', ['user', 'name']); + request.user.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateUser(request), expectedError); + }); + }); + + describe('listUsers', () => { + it('invokes listUsers without error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + ]; + client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); + const [response] = await client.listUsers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsers without error using callback', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + ]; + client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsers( + request, + (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IUser[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsers with error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUsers(request), expectedError); + const actualRequest = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsersStream without error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + ]; + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUsersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.User[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.User) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); + assert( + (client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsersStream with error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.shopping.merchant.accounts.v1beta.User[] = []; + stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.User) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); + assert( + (client.descriptors.page.listUsers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsers without error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), + ]; + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.shopping.merchant.accounts.v1beta.IUser[] = []; + const iterable = client.listUsersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsers with error', async () => { + const client = new userserviceModule.v1beta.UserServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.shopping.merchant.accounts.v1beta.IUser[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUsers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('account', () => { + const fakePath = "/rendered/path/account"; + const expectedParameters = { + account: "accountValue", + }; + const client = new userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 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 = { + account: "accountValue", + }; + const client = new userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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 userserviceModule.v1beta.UserServiceClient({ + 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/tsconfig.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/webpack.config.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/webpack.config.js new file mode 100644 index 00000000000..f335a762c1c --- /dev/null +++ b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AccountIssueService', + filename: './account-issue-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 51bad9ed96c8da39fddb7acae4a25189d5a5fa53 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 26 Sep 2024 00:30:03 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../v1beta/.eslintignore | 7 - .../v1beta/.eslintrc.json | 3 - .../v1beta/.gitignore | 14 - .../v1beta/.jsdoc.js | 55 - .../v1beta/.mocharc.js | 33 - .../v1beta/.prettierrc.js | 22 - .../v1beta/README.md | 1 - .../v1beta/package.json | 72 - .../accounts/v1beta/accessright.proto | 37 - .../accounts/v1beta/account_tax.proto | 143 - .../accounts/v1beta/accountissue.proto | 155 - .../merchant/accounts/v1beta/accounts.proto | 304 - .../accounts/v1beta/businessidentity.proto | 160 - .../accounts/v1beta/businessinfo.proto | 114 - .../accounts/v1beta/customerservice.proto | 38 - .../accounts/v1beta/emailpreferences.proto | 128 - .../merchant/accounts/v1beta/homepage.proto | 147 - .../v1beta/online_return_policy.proto | 264 - .../v1beta/phoneverificationstate.proto | 34 - .../merchant/accounts/v1beta/programs.proto | 220 - .../merchant/accounts/v1beta/regions.proto | 254 - .../accounts/v1beta/shippingsettings.proto | 719 - .../merchant/accounts/v1beta/tax_rule.proto | 87 - .../accounts/v1beta/termsofservice.proto | 145 - .../v1beta/termsofserviceagreementstate.proto | 169 - .../accounts/v1beta/termsofservicekind.proto | 31 - .../merchant/accounts/v1beta/user.proto | 217 - .../protos/google/shopping/type/types.proto | 193 - .../v1beta/protos/protos.d.ts | 22846 ------ .../v1beta/protos/protos.js | 57252 ---------------- .../v1beta/protos/protos.json | 6551 -- ...count_issue_service.list_account_issues.js | 90 - .../account_tax_service.get_account_tax.js | 61 - .../account_tax_service.list_account_tax.js | 73 - .../account_tax_service.update_account_tax.js | 65 - ...ts_service.create_and_configure_account.js | 80 - .../v1beta/accounts_service.delete_account.js | 62 - .../v1beta/accounts_service.get_account.js | 62 - .../v1beta/accounts_service.list_accounts.js | 78 - .../accounts_service.list_sub_accounts.js | 77 - .../v1beta/accounts_service.update_account.js | 66 - ..._identity_service.get_business_identity.js | 62 - ...entity_service.update_business_identity.js | 66 - ...business_info_service.get_business_info.js | 62 - ...iness_info_service.update_business_info.js | 66 - ...eferences_service.get_email_preferences.js | 62 - ...rences_service.update_email_preferences.js | 66 - .../v1beta/homepage_service.claim_homepage.js | 62 - .../v1beta/homepage_service.get_homepage.js | 62 - .../homepage_service.unclaim_homepage.js | 62 - .../homepage_service.update_homepage.js | 66 - ...policy_service.get_online_return_policy.js | 62 - ...icy_service.list_online_return_policies.js | 82 - .../programs_service.disable_program.js | 62 - .../v1beta/programs_service.enable_program.js | 62 - .../v1beta/programs_service.get_program.js | 62 - .../v1beta/programs_service.list_programs.js | 75 - .../v1beta/regions_service.create_region.js | 73 - .../v1beta/regions_service.delete_region.js | 62 - .../v1beta/regions_service.get_region.js | 62 - .../v1beta/regions_service.list_regions.js | 78 - .../v1beta/regions_service.update_region.js | 67 - ..._settings_service.get_shipping_settings.js | 62 - ...ttings_service.insert_shipping_settings.js | 67 - ...gle.shopping.merchant.accounts.v1beta.json | 1967 - ...ce.get_terms_of_service_agreement_state.js | 63 - ...cation_terms_of_service_agreement_state.js | 62 - ...service_service.accept_terms_of_service.js | 74 - ...of_service_service.get_terms_of_service.js | 62 - ...ervice.retrieve_latest_terms_of_service.js | 68 - .../v1beta/user_service.create_user.js | 73 - .../v1beta/user_service.delete_user.js | 64 - .../generated/v1beta/user_service.get_user.js | 65 - .../v1beta/user_service.list_users.js | 77 - .../v1beta/user_service.update_user.js | 68 - .../v1beta/src/index.ts | 53 - .../v1beta/account_issue_service_client.ts | 1065 - .../account_issue_service_client_config.json | 43 - .../account_issue_service_proto_list.json | 24 - .../src/v1beta/account_tax_service_client.ts | 1172 - .../account_tax_service_client_config.json | 53 - .../account_tax_service_proto_list.json | 24 - .../src/v1beta/accounts_service_client.ts | 1527 - .../accounts_service_client_config.json | 68 - .../v1beta/accounts_service_proto_list.json | 24 - .../business_identity_service_client.ts | 983 - ...siness_identity_service_client_config.json | 48 - .../business_identity_service_proto_list.json | 24 - .../v1beta/business_info_service_client.ts | 982 - .../business_info_service_client_config.json | 48 - .../business_info_service_proto_list.json | 24 - .../email_preferences_service_client.ts | 997 - ...ail_preferences_service_client_config.json | 48 - .../email_preferences_service_proto_list.json | 24 - .../v1beta/src/v1beta/gapic_metadata.json | 701 - .../src/v1beta/homepage_service_client.ts | 1136 - .../homepage_service_client_config.json | 58 - .../v1beta/homepage_service_proto_list.json | 24 - .../v1beta/src/v1beta/index.ts | 33 - .../online_return_policy_service_client.ts | 1128 - ...e_return_policy_service_client_config.json | 48 - ...line_return_policy_service_proto_list.json | 24 - .../src/v1beta/programs_service_client.ts | 1254 - .../programs_service_client_config.json | 58 - .../v1beta/programs_service_proto_list.json | 24 - .../src/v1beta/regions_service_client.ts | 1340 - .../v1beta/regions_service_client_config.json | 63 - .../v1beta/regions_service_proto_list.json | 24 - .../shipping_settings_service_client.ts | 984 - ...ipping_settings_service_client_config.json | 34 - .../shipping_settings_service_proto_list.json | 24 - ..._service_agreement_state_service_client.ts | 981 - ...agreement_state_service_client_config.json | 48 - ...ce_agreement_state_service_proto_list.json | 24 - .../v1beta/terms_of_service_service_client.ts | 1056 - ...erms_of_service_service_client_config.json | 53 - .../terms_of_service_service_proto_list.json | 24 - .../v1beta/src/v1beta/user_service_client.ts | 1341 - .../v1beta/user_service_client_config.json | 63 - .../src/v1beta/user_service_proto_list.json | 24 - .../system-test/fixtures/sample/src/index.js | 41 - .../system-test/fixtures/sample/src/index.ts | 116 - .../v1beta/system-test/install.ts | 49 - .../gapic_account_issue_service_v1beta.ts | 1023 - .../test/gapic_account_tax_service_v1beta.ts | 1243 - .../test/gapic_accounts_service_v1beta.ts | 1601 - .../gapic_autofeed_settings_service_v1beta.ts | 951 - .../gapic_business_identity_service_v1beta.ts | 951 - .../gapic_business_info_service_v1beta.ts | 951 - .../gapic_email_preferences_service_v1beta.ts | 951 - .../test/gapic_homepage_service_v1beta.ts | 1167 - ...pic_online_return_policy_service_v1beta.ts | 1131 - .../test/gapic_programs_service_v1beta.ts | 1347 - .../test/gapic_regions_service_v1beta.ts | 1459 - .../gapic_shipping_settings_service_v1beta.ts | 947 - ..._service_agreement_state_service_v1beta.ts | 947 - .../gapic_terms_of_service_service_v1beta.ts | 1022 - .../v1beta/test/gapic_user_service_v1beta.ts | 1459 - .../v1beta/tsconfig.json | 19 - .../v1beta/webpack.config.js | 64 - .../README.md | 6 +- .../accounts/v1beta/accountissue.proto | 3 +- .../merchant/accounts/v1beta/accounts.proto | 27 +- .../accounts/v1beta/accountservices.proto | 0 .../accounts/v1beta/autofeedsettings.proto | 0 .../accounts/v1beta/businessinfo.proto | 6 + .../accounts/v1beta/shippingsettings.proto | 6 +- .../accounts/v1beta/termsofservice.proto | 12 +- .../v1beta/termsofserviceagreementstate.proto | 3 + .../protos/protos.d.ts | 483 +- .../protos/protos.js | 1275 +- .../protos/protos.json | 144 +- .../samples/README.md | 36 + ...count_issue_service.list_account_issues.js | 2 +- ...ts_service.create_and_configure_account.js | 12 +- ..._settings_service.get_autofeed_settings.js | 0 ...ttings_service.update_autofeed_settings.js | 0 ...gle.shopping.merchant.accounts.v1beta.json | 92 +- ...ce.get_terms_of_service_agreement_state.js | 1 + ...ervice.retrieve_latest_terms_of_service.js | 12 +- .../src/index.ts | 4 + .../v1beta/account_issue_service_client.ts | 34 +- .../account_issue_service_client_config.json | 17 +- .../account_issue_service_proto_list.json | 2 + .../src/v1beta/account_tax_service_client.ts | 28 + .../account_tax_service_client_config.json | 27 +- .../account_tax_service_proto_list.json | 2 + .../src/v1beta/accounts_service_client.ts | 39 +- .../v1beta/accounts_service_proto_list.json | 2 + .../autofeed_settings_service_client.ts | 503 +- ...tofeed_settings_service_client_config.json | 0 .../autofeed_settings_service_proto_list.json | 0 .../business_identity_service_client.ts | 28 + ...siness_identity_service_client_config.json | 22 +- .../business_identity_service_proto_list.json | 2 + .../v1beta/business_info_service_client.ts | 28 + .../business_info_service_client_config.json | 22 +- .../business_info_service_proto_list.json | 2 + .../email_preferences_service_client.ts | 28 + ...ail_preferences_service_client_config.json | 22 +- .../email_preferences_service_proto_list.json | 2 + .../src/v1beta/gapic_metadata.json | 34 + .../src/v1beta/homepage_service_client.ts | 28 + .../homepage_service_client_config.json | 32 +- .../v1beta/homepage_service_proto_list.json | 2 + .../src/v1beta/index.ts | 1 + .../online_return_policy_service_client.ts | 28 + ...line_return_policy_service_proto_list.json | 2 + .../src/v1beta/programs_service_client.ts | 28 + .../programs_service_client_config.json | 32 +- .../v1beta/programs_service_proto_list.json | 2 + .../src/v1beta/regions_service_client.ts | 28 + .../v1beta/regions_service_client_config.json | 37 +- .../v1beta/regions_service_proto_list.json | 2 + .../shipping_settings_service_client.ts | 28 + .../shipping_settings_service_proto_list.json | 2 + ..._service_agreement_state_service_client.ts | 29 + ...agreement_state_service_client_config.json | 22 +- ...ce_agreement_state_service_proto_list.json | 2 + .../v1beta/terms_of_service_service_client.ts | 36 +- .../terms_of_service_service_proto_list.json | 2 + .../src/v1beta/user_service_client.ts | 28 + .../v1beta/user_service_client_config.json | 37 +- .../src/v1beta/user_service_proto_list.json | 2 + .../system-test/fixtures/sample/src/index.js | 2 + .../system-test/fixtures/sample/src/index.ts | 9 + .../gapic_account_issue_service_v1beta.ts | 42 + .../test/gapic_account_tax_service_v1beta.ts | 43 + .../test/gapic_accounts_service_v1beta.ts | 41 + .../gapic_autofeed_settings_service_v1beta.ts | 1255 + .../gapic_business_identity_service_v1beta.ts | 42 + .../gapic_business_info_service_v1beta.ts | 42 + .../gapic_email_preferences_service_v1beta.ts | 42 + .../test/gapic_homepage_service_v1beta.ts | 41 + ...pic_online_return_policy_service_v1beta.ts | 44 + .../test/gapic_programs_service_v1beta.ts | 41 + .../test/gapic_regions_service_v1beta.ts | 41 + .../gapic_shipping_settings_service_v1beta.ts | 42 + ..._service_agreement_state_service_v1beta.ts | 44 + .../gapic_terms_of_service_service_v1beta.ts | 42 + .../test/gapic_user_service_v1beta.ts | 41 + 221 files changed, 4792 insertions(+), 130965 deletions(-) delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintignore delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintrc.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.gitignore delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.jsdoc.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.mocharc.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/.prettierrc.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/README.md delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/package.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accessright.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/account_tax.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accounts.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/customerservice.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/emailpreferences.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/homepage.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/online_return_policy.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/programs.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/regions.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/tax_rule.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservicekind.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/user.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/type/types.proto delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_issue_service.list_account_issues.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.get_account_tax.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.list_account_tax.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.update_account_tax.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.create_and_configure_account.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.delete_account.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.get_account.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_accounts.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_sub_accounts.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.update_account.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.get_business_identity.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.update_business_identity.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.get_business_info.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.update_business_info.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.get_email_preferences.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.update_email_preferences.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.claim_homepage.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.get_homepage.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.unclaim_homepage.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.update_homepage.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.get_online_return_policy.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.disable_program.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.enable_program.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.get_program.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.list_programs.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.create_region.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.delete_region.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.get_region.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.list_regions.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.update_region.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.get_shipping_settings.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.insert_shipping_settings.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.get_terms_of_service.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.create_user.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.delete_user.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.get_user.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.list_users.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.update_user.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/index.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/index.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client_config.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_proto_list.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/install.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_issue_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_tax_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_accounts_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_autofeed_settings_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_identity_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_info_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_email_preferences_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_homepage_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_online_return_policy_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_programs_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_regions_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_shipping_settings_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_agreement_state_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_user_service_v1beta.ts delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/tsconfig.json delete mode 100644 owl-bot-staging/google-shopping-merchant-accounts/v1beta/webpack.config.js rename {owl-bot-staging/google-shopping-merchant-accounts/v1beta => packages/google-shopping-merchant-accounts}/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto (100%) rename {owl-bot-staging/google-shopping-merchant-accounts/v1beta => packages/google-shopping-merchant-accounts}/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto (100%) rename {owl-bot-staging/google-shopping-merchant-accounts/v1beta => packages/google-shopping-merchant-accounts}/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js (100%) rename {owl-bot-staging/google-shopping-merchant-accounts/v1beta => packages/google-shopping-merchant-accounts}/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js (100%) rename {owl-bot-staging/google-shopping-merchant-accounts/v1beta => packages/google-shopping-merchant-accounts}/src/v1beta/autofeed_settings_service_client.ts (70%) rename {owl-bot-staging/google-shopping-merchant-accounts/v1beta => packages/google-shopping-merchant-accounts}/src/v1beta/autofeed_settings_service_client_config.json (100%) rename {owl-bot-staging/google-shopping-merchant-accounts/v1beta => packages/google-shopping-merchant-accounts}/src/v1beta/autofeed_settings_service_proto_list.json (100%) create mode 100644 packages/google-shopping-merchant-accounts/test/gapic_autofeed_settings_service_v1beta.ts diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintignore b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintrc.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.gitignore b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.jsdoc.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.jsdoc.js deleted file mode 100644 index 4be7d1c0e84..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// 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'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2024 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-shopping/accounts', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.mocharc.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.mocharc.js deleted file mode 100644 index 13b67c34edc..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.prettierrc.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.prettierrc.js deleted file mode 100644 index 9a8fd690982..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/README.md b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/README.md deleted file mode 100644 index ff398a3c4cf..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/README.md +++ /dev/null @@ -1 +0,0 @@ -Accounts: Nodejs Client diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/package.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/package.json deleted file mode 100644 index 97fd6d0ebf7..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "@google-shopping/accounts", - "version": "0.1.0", - "description": "Accounts client for Node.js", - "repository": "googleapis/nodejs-accounts", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google accounts", - "accounts", - "account issue service", - "accounts service", - "account tax service", - "autofeed settings service", - "business identity service", - "business info service", - "email preferences service", - "homepage service", - "online return policy service", - "programs service", - "regions service", - "shipping settings service", - "terms of service agreement state service", - "terms of service service", - "user service" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accessright.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accessright.proto deleted file mode 100644 index 40d972f5cc2..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accessright.proto +++ /dev/null @@ -1,37 +0,0 @@ -// 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; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "AccessRightProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// The access right. -enum AccessRight { - // Default value. This value is unused. - ACCESS_RIGHT_UNSPECIFIED = 0; - - // Standard access rights. - STANDARD = 1; - - // Admin access rights. - ADMIN = 2; - - // Users with this right have access to performance and insights. - PERFORMANCE_REPORTING = 3; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/account_tax.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/account_tax.proto deleted file mode 100644 index 440ddcba346..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/account_tax.proto +++ /dev/null @@ -1,143 +0,0 @@ -// 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"; -import "google/shopping/merchant/accounts/v1beta/tax_rule.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "AccountTaxProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Manages account level tax setting data. -// -// This API defines the following resource model: -// -// - [AccountTax][google.shopping.merchant.accounts.v1main.AccountTax] -service AccountTaxService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Returns the tax rules that match the conditions of GetAccountTaxRequest - rpc GetAccountTax(GetAccountTaxRequest) returns (AccountTax) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/accounttax/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists the tax settings of the sub-accounts only in your - // Merchant Center account. - // This method can only be called on a multi-client account, otherwise it'll - // return an error. - rpc ListAccountTax(ListAccountTaxRequest) returns (ListAccountTaxResponse) { - option (google.api.http) = { - get: "/accounts/v1beta/{parent=accounts/*}/accounttax" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates the tax settings of the account. - rpc UpdateAccountTax(UpdateAccountTaxRequest) returns (AccountTax) { - option (google.api.http) = { - patch: "/accounts/v1beta/{account_tax.name=accounts/*/accounttax/*}" - body: "account_tax" - }; - option (google.api.method_signature) = "account_tax,update_mask"; - option (google.api.method_signature) = "account_tax"; - } -} - -// The tax settings of a merchant account. All methods require the admin role. -message AccountTax { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/AccountTax" - pattern: "accounts/{account}/accounttax/{tax}" - plural: "accountTaxes" - singular: "accountTax" - }; - - // Identifier. The name of the tax setting. - // Format: - // "{account_tax.name=accounts/{account}}" - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The ID of the account to which these account tax settings - // belong. - int64 account = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Tax rules. "Define the tax rules in each region. - // No tax will be presented if a region has no rule." - repeated TaxRule tax_rules = 3; -} - -// Request to get tax settings -message GetAccountTaxRequest { - // Required. The name from which tax settings will be retrieved - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/AccountTax" - } - ]; -} - -// Request to update the tax settings -message UpdateAccountTaxRequest { - // Required. The tax setting that will be updated - AccountTax account_tax = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated - google.protobuf.FieldMask update_mask = 2; -} - -// Request to list all sub-account tax settings only for the requesting merchant -// This method can only be called on a multi-client account, otherwise it'll -// return an error. -message ListAccountTaxRequest { - // Required. The parent, which owns this collection of account tax. - // Format: accounts/{account} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "merchantapi.googleapis.com/AccountTax" - } - ]; - - // The maximum number of tax settings to return in the response, used for - // paging. - int32 page_size = 2; - - // The token returned by the previous request. - string page_token = 3; -} - -// Response to account tax list request -// This method can only be called on a multi-client account, otherwise it'll -// return an error. -message ListAccountTaxResponse { - // Page of accounttax settings - repeated AccountTax account_taxes = 1; - - // The token for the retrieval of the next page of account tax settings. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto deleted file mode 100644 index 8651baa5a2a..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountissue.proto +++ /dev/null @@ -1,155 +0,0 @@ -// 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/shopping/type/types.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "AccountIssueProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to support `AccountIssueService` API. -service AccountIssueService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Lists all account issues of a Merchant Center account. - rpc ListAccountIssues(ListAccountIssuesRequest) - returns (ListAccountIssuesResponse) { - option (google.api.http) = { - get: "/accounts/v1beta/{parent=accounts/*}/issues" - }; - option (google.api.method_signature) = "parent"; - } -} - -// An -// [`AccountIssue`](https://support.google.com/merchants/answer/12153802?sjid=17798438912526418908-EU#account). -message AccountIssue { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/AccountIssue" - pattern: "accounts/{account}/issues/{issue}" - plural: "accountIssues" - singular: "accountIssue" - }; - - // The impact of the issue on a destination. - message ImpactedDestination { - // The impact of the issue on a region. - message Impact { - // The [CLDR region code](https://cldr.unicode.org/) where this issue - // applies. - string region_code = 1; - - // The severity of the issue on the destination and region. - Severity severity = 2; - } - - // The impacted reporting context. - optional google.shopping.type.ReportingContext.ReportingContextEnum - reporting_context = 1; - - // The (negative) impact for various regions on the given destination. - repeated Impact impacts = 2; - } - - // All possible issue severities. - enum Severity { - // The severity is unknown. - SEVERITY_UNSPECIFIED = 0; - - // The issue causes offers to not serve. - CRITICAL = 1; - - // The issue might affect offers (in the future) or might be an - // indicator of issues with offers. - ERROR = 2; - - // The issue is a suggestion for improvement. - SUGGESTION = 3; - } - - // Identifier. The resource name of the account issue. - // Format: `accounts/{account}/issues/{id}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // The localized title of the issue. - string title = 2; - - // The overall severity of the issue. - Severity severity = 3; - - // The impact this issue has on various destinations. - repeated ImpactedDestination impacted_destinations = 4; - - // Further localized details about the issue. - string detail = 5; - - // Link to Merchant Center Help Center providing further information about the - // issue and how to fix it. - string documentation_uri = 6; -} - -// Request message for the `ListAccountIssues` method. -message ListAccountIssuesRequest { - // Required. The parent, which owns this collection of issues. - // Format: `accounts/{account}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; - - // Optional. The maximum number of issues to return. The service may return - // fewer than this value. If unspecified, at most 50 users will be returned. - // The maximum value is 100; values above 100 will be coerced to 100 - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListAccountIssues` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListAccountIssues` must - // match the call that provided the page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The issues in the response will have human-readable fields in the - // 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. - string language_code = 4 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for the `ListAccountIssues` method. -message ListAccountIssuesResponse { - // The issues from the specified account. - repeated AccountIssue account_issues = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accounts.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accounts.proto deleted file mode 100644 index 63a51cc07d4..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accounts.proto +++ /dev/null @@ -1,304 +0,0 @@ -// 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/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"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "AccountsProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to support Accounts API. -service AccountsService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Retrieves an account from your Merchant Center account. - // After inserting, updating, or deleting an account, it may take several - // minutes before changes take effect. - rpc GetAccount(GetAccountRequest) returns (Account) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a standalone Merchant Center account with additional configuration. - // Adds the user that makes the request as an admin for the new account. - rpc CreateAndConfigureAccount(CreateAndConfigureAccountRequest) - returns (Account) { - option (google.api.http) = { - post: "/accounts/v1beta/accounts:createAndConfigure" - body: "*" - }; - } - - // Deletes the specified account regardless of its type: standalone, MCA or - // sub-account. Deleting an MCA leads to the deletion of all of its - // sub-accounts. Executing this method requires admin access. - rpc DeleteAccount(DeleteAccountRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/accounts/v1beta/{name=accounts/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates an account regardless of its type: standalone, MCA or sub-account. - // Executing this method requires admin access. - rpc UpdateAccount(UpdateAccountRequest) returns (Account) { - option (google.api.http) = { - patch: "/accounts/v1beta/{account.name=accounts/*}" - body: "account" - }; - option (google.api.method_signature) = "account,update_mask"; - } - - // Lists accounts accessible to the calling user and matching the - // constraints of the request such as page size or filters. - // This is not just listing the sub-accounts of an MCA, but all accounts the - // calling user has access to including other MCAs, linked accounts, - // standalone accounts and so on. - rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) { - option (google.api.http) = { - get: "/accounts/v1beta/accounts" - }; - } - - // List all sub-accounts for a given multi client account. This is a - // convenience wrapper for the more powerful `ListAccounts` method. This - // method will produce the same results as calling `ListsAccounts` with the - // following filter: - // `relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))` - rpc ListSubAccounts(ListSubAccountsRequest) - returns (ListSubAccountsResponse) { - option (google.api.http) = { - get: "/accounts/v1beta/{provider=accounts/*}:listSubaccounts" - }; - option (google.api.method_signature) = "provider"; - } -} - -// An account. -message Account { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/Account" - pattern: "accounts/{account}" - }; - - // Identifier. The resource name of the account. - // Format: `accounts/{account}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The ID of the account. - int64 account_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. A human-readable name of the account. See - // [store name](https://support.google.com/merchants/answer/160556) and - // [business name](https://support.google.com/merchants/answer/12159159) for - // more information. - string account_name = 3 [(google.api.field_behavior) = REQUIRED]; - - // Whether this account contains adult content. - bool adult_content = 4; - - // Output only. Whether this is a test account. - bool test_account = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The time zone of the account. - // - // On writes, `time_zone` sets both the `reporting_time_zone` and the - // `display_time_zone`. - // - // For reads, `time_zone` always returns the `display_time_zone`. If - // `display_time_zone` doesn't exist for your account, `time_zone` is empty. - google.type.TimeZone time_zone = 6 [(google.api.field_behavior) = REQUIRED]; - - // Required. The account's [BCP-47 language - // code](https://tools.ietf.org/html/bcp47), such as `en-US` or `sr-Latn`. - string language_code = 7 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for the `GetAccount` method. -message GetAccountRequest { - // Required. The name of the account to retrieve. - // Format: `accounts/{account}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; -} - -// Request message for the `CreateAndConfigureAccount` method. -message CreateAndConfigureAccountRequest { - // Reference to a Terms of Service resource. - message AcceptTermsOfService { - // 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) = { - type: "merchantapi.googleapis.com/TermsOfService" - } - ]; - - // 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 = 3 [(google.api.field_behavior) = REQUIRED]; - } - - // Additional instructions to add account services during creation of the - // account. - message AddAccountService { - // The service type to be added. - oneof service_type { - // 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. - // Format: `accounts/{account}` - optional string provider = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; - } - - // Required. The account to be created. - Account account = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Users to be added to the account. - repeated CreateUserRequest users = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Terms of Service (ToS) to be accepted immediately upon - // account creation. - optional AcceptTermsOfService accept_terms_of_service = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // 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) = REQUIRED]; -} - -// Request message for the `DeleteAccount` method. -message DeleteAccountRequest { - // Required. The name of the account to delete. - // Format: `accounts/{account}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; -} - -// Request message for the `UpdateAccount` method. -message UpdateAccountRequest { - // Required. The new version of the account. - Account account = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. List of fields being updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for the `ListAccounts` method. -message ListAccountsRequest { - // Optional. The maximum number of accounts to return. The service may return - // fewer than this value. If unspecified, at most 250 accounts are returned. - // The maximum value is 500; values above 500 are coerced to 500. - int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListAccounts` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListAccounts` must match - // the call that provided the page token. - string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Returns only accounts that match the - // [filter](/merchant/api/guides/accounts/filter). - // For more details, see the - // [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). - string filter = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for the `ListAccounts` method. -message ListAccountsResponse { - // The accounts matching the `ListAccountsRequest`. - repeated Account accounts = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for the `ListSubAccounts` method. -message ListSubAccountsRequest { - // Required. The parent account. - // Format: `accounts/{account}` - string provider = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; - - // Optional. The maximum number of accounts to return. The service may return - // fewer than this value. If unspecified, at most 250 accounts are returned. - // The maximum value is 500; values above 500 are coerced to 500. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListAccounts` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListAccounts` must match - // the call that provided the page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for the `ListSubAccounts` method. -message ListSubAccountsResponse { - // The accounts for which the given parent account is an aggregator. - repeated Account accounts = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto deleted file mode 100644 index c7f02c421b3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessidentity.proto +++ /dev/null @@ -1,160 +0,0 @@ -// 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 = "BusinessIdentityProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to support [business -// identity](https://support.google.com/merchants/answer/12564247) API. -service BusinessIdentityService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Retrieves the business identity of an account. - rpc GetBusinessIdentity(GetBusinessIdentityRequest) - returns (BusinessIdentity) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/businessIdentity}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates the business identity of an account. Executing this method requires - // admin access. - rpc UpdateBusinessIdentity(UpdateBusinessIdentityRequest) - returns (BusinessIdentity) { - option (google.api.http) = { - patch: "/accounts/v1beta/{business_identity.name=accounts/*/businessIdentity}" - body: "business_identity" - }; - option (google.api.method_signature) = "business_identity,update_mask"; - } -} - -// Collection of information related to the [identity of a -// business](https://support.google.com/merchants/answer/12564247). -message BusinessIdentity { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/BusinessIdentity" - pattern: "accounts/{account}/businessIdentity" - plural: "businessIdentities" - singular: "businessIdentity" - }; - - // All information related to an identity attribute. - message IdentityAttribute { - // All possible settings regarding the declaration of an identity. - enum IdentityDeclaration { - // Default value indicating that no selection was made. - IDENTITY_DECLARATION_UNSPECIFIED = 0; - - // Indicates that the account identifies with the attribute. - SELF_IDENTIFIES_AS = 1; - - // Indicates that the account does not identify with the attribute. - DOES_NOT_SELF_IDENTIFY_AS = 2; - } - - // Required. The declaration of identity for this attribute. - IdentityDeclaration identity_declaration = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // All possible settings regarding promotions related to the business - // identity. - enum PromotionsConsent { - // Default value indicating that no selection was made. - PROMOTIONS_CONSENT_UNSPECIFIED = 0; - - // Indicates that the account consented to having their business identity - // used for promotions. - PROMOTIONS_CONSENT_GIVEN = 1; - - // Indicates that the account did not consent to having their business - // identity used for promotions. - PROMOTIONS_CONSENT_DENIED = 2; - } - - // Identifier. The resource name of the business identity. - // Format: `accounts/{account}/businessIdentity` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. Whether the identity attributes may be used for promotions. - PromotionsConsent promotions_consent = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies whether the business identifies itself as being - // black-owned. This optional field will only be available for merchants with - // a business country set to `US`. It is also not applicable for marketplaces - // or marketplace sellers. - IdentityAttribute black_owned = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies whether the business identifies itself as being - // women-owned. This optional field will only be available for merchants with - // a business country set to `US`. It is also not applicable for marketplaces - // or marketplace sellers. - IdentityAttribute women_owned = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies whether the business identifies itself as being - // veteran-owned. This optional field will only be available for merchants - // with a business country set to `US`. It is also not applicable for - // marketplaces or marketplace sellers. - IdentityAttribute veteran_owned = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies whether the business identifies itself as being - // latino-owned. This optional field will only be available for merchants with - // a business country set to `US`. It is also not applicable for marketplaces - // or marketplace sellers. - IdentityAttribute latino_owned = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies whether the business identifies itself as a small - // business. This optional field will only be available for merchants with a - // business country set to `US`. It is also not applicable for marketplaces. - IdentityAttribute small_business = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for the `GetBusinessIdentity` method. -message GetBusinessIdentityRequest { - // Required. The resource name of the business identity. - // Format: `accounts/{account}/businessIdentity` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/BusinessIdentity" - } - ]; -} - -// Request message for the `UpdateBusinessIdentity` method. -message UpdateBusinessIdentityRequest { - // Required. The new version of the business identity. - BusinessIdentity business_identity = 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto deleted file mode 100644 index b040b3d1073..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/businessinfo.proto +++ /dev/null @@ -1,114 +0,0 @@ -// 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"; -import "google/shopping/merchant/accounts/v1beta/customerservice.proto"; -import "google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto"; -import "google/type/phone_number.proto"; -import "google/type/postal_address.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "BusinessInfoProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to support business info API. -service BusinessInfoService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Retrieves the business info of an account. - rpc GetBusinessInfo(GetBusinessInfoRequest) returns (BusinessInfo) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/businessInfo}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates the business info of an account. Executing this method requires - // admin access. - rpc UpdateBusinessInfo(UpdateBusinessInfoRequest) returns (BusinessInfo) { - option (google.api.http) = { - patch: "/accounts/v1beta/{business_info.name=accounts/*/businessInfo}" - body: "business_info" - }; - option (google.api.method_signature) = "business_info,update_mask"; - } -} - -// Collection of information related to a business. -message BusinessInfo { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/BusinessInfo" - pattern: "accounts/{account}/businessInfo" - plural: "businessInfos" - singular: "businessInfo" - }; - - // Identifier. The resource name of the business info. - // Format: `accounts/{account}/businessInfo` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. The address of the business. - optional google.type.PostalAddress address = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The phone number of the business. - optional google.type.PhoneNumber phone = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The phone verification state of the business. - optional PhoneVerificationState phone_verification_state = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. -message GetBusinessInfoRequest { - // Required. The resource name of the business info. - // Format: `accounts/{account}/businessInfo` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/BusinessInfo" - } - ]; -} - -// Request message for the `UpdateBusinessInfo` method. -message UpdateBusinessInfoRequest { - // Required. The new version of the business info. - BusinessInfo business_info = 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/customerservice.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/customerservice.proto deleted file mode 100644 index a9cd9f42c25..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/customerservice.proto +++ /dev/null @@ -1,38 +0,0 @@ -// 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/field_behavior.proto"; -import "google/type/phone_number.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "CustomerServiceProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Customer service information. -message CustomerService { - // Optional. The URI where customer service may be found. - optional string uri = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The email address where customer service may be reached. - optional string email = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The phone number where customer service may be called. - optional google.type.PhoneNumber phone = 3 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/emailpreferences.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/emailpreferences.proto deleted file mode 100644 index 24bd0ab243d..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/emailpreferences.proto +++ /dev/null @@ -1,128 +0,0 @@ -// 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 = "EmailPreferencesProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to support the `EmailPreferences` API. -// -// This service only permits retrieving and updating email preferences for the -// authenticated user. -service EmailPreferencesService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Returns the email preferences for a Merchant Center account user. - // - // Use the name=accounts/*/users/me/emailPreferences alias to get preferences - // for the authenticated user. - rpc GetEmailPreferences(GetEmailPreferencesRequest) - returns (EmailPreferences) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/users/*/emailPreferences}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates the email preferences for a Merchant Center account user. MCA users - // should specify the MCA account rather than a sub-account of the MCA. - // - // Preferences which are not explicitly selected in the update mask will not - // be updated. - // - // It is invalid for updates to specify an UNCONFIRMED opt-in status value. - // - // Use the name=accounts/*/users/me/emailPreferences alias to update - // preferences - // for the authenticated user. - rpc UpdateEmailPreferences(UpdateEmailPreferencesRequest) - returns (EmailPreferences) { - option (google.api.http) = { - patch: "/accounts/v1beta/{email_preferences.name=accounts/*/users/*/emailPreferences}" - body: "email_preferences" - }; - option (google.api.method_signature) = "email_preferences,update_mask"; - } -} - -// The categories of notifications the user opted into / opted out of. The email -// preferences do not include mandatory announcements as users can't opt out of -// them. -message EmailPreferences { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/EmailPreferences" - pattern: "accounts/{account}/users/{email}/emailPreferences" - plural: "emailPreferences" - singular: "emailPreferences" - }; - - // Opt in state of the email preference. - enum OptInState { - // Opt-in status is not specified. - OPT_IN_STATE_UNSPECIFIED = 0; - - // User has opted out of receiving this type of email. - OPTED_OUT = 1; - - // User has opted in to receiving this type of email. - OPTED_IN = 2; - - // User has opted in to receiving this type of email and the confirmation - // email has been sent, but user has not yet confirmed the opt in (applies - // only to certain countries). - UNCONFIRMED = 3; - } - - // Identifier. The name of the EmailPreferences. The endpoint is only - // supported for the authenticated user. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. Updates on new features, tips and best practices. - OptInState news_and_tips = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for GetEmailPreferences method. -message GetEmailPreferencesRequest { - // Required. The name of the `EmailPreferences` resource. - // Format: `accounts/{account}/users/{email}/emailPreferences` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/EmailPreferences" - } - ]; -} - -// Request message for UpdateEmailPreferences method. -message UpdateEmailPreferencesRequest { - // Required. Email Preferences to be updated. - EmailPreferences email_preferences = 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/homepage.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/homepage.proto deleted file mode 100644 index aedfa98cd62..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/homepage.proto +++ /dev/null @@ -1,147 +0,0 @@ -// 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 = "HomepageProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to support an API for a store's homepage. -service HomepageService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Retrieves a store's homepage. - rpc GetHomepage(GetHomepageRequest) returns (Homepage) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/homepage}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a store's homepage. Executing this method requires admin access. - rpc UpdateHomepage(UpdateHomepageRequest) returns (Homepage) { - option (google.api.http) = { - patch: "/accounts/v1beta/{homepage.name=accounts/*/homepage}" - body: "homepage" - }; - option (google.api.method_signature) = "homepage,update_mask"; - } - - // Claims a store's homepage. Executing this method requires admin access. - // - // If the homepage is already claimed, this will recheck the - // verification (unless the merchant is exempted from claiming, which also - // exempts from verification) and return a successful response. If ownership - // can no longer be verified, it will return an error, but it won't clear the - // claim. In case of failure, a canonical error message will be returned: - // * PERMISSION_DENIED: user doesn't have the necessary permissions on this - // MC account; - // * FAILED_PRECONDITION: - // - The account is not a Merchant Center account; - // - MC account doesn't have a homepage; - // - claiming failed (in this case the error message will contain more - // details). - rpc ClaimHomepage(ClaimHomepageRequest) returns (Homepage) { - option (google.api.http) = { - post: "/accounts/v1beta/{name=accounts/*/homepage}:claim" - body: "*" - }; - } - - // Unclaims a store's homepage. Executing this method requires admin access. - rpc UnclaimHomepage(UnclaimHomepageRequest) returns (Homepage) { - option (google.api.http) = { - post: "/accounts/v1beta/{name=accounts/*/homepage}:unclaim" - body: "*" - }; - } -} - -// A store's homepage. -message Homepage { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/Homepage" - pattern: "accounts/{account}/homepage" - plural: "homepages" - singular: "homepage" - }; - - // Identifier. The resource name of the store's homepage. - // Format: `accounts/{account}/homepage` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Required. The URI (typically a URL) of the store's homepage. - optional string uri = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Whether the homepage is claimed. See - // https://support.google.com/merchants/answer/176793. - bool claimed = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for the `GetHomepage` method. -message GetHomepageRequest { - // Required. The name of the homepage to retrieve. - // Format: `accounts/{account}/homepage` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Homepage" - } - ]; -} - -// Request message for the `UpdateHomepage` method. -message UpdateHomepageRequest { - // Required. The new version of the homepage. - Homepage homepage = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. List of fields being updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for the `ClaimHomepage` method. -message ClaimHomepageRequest { - // Required. The name of the homepage to claim. - // Format: `accounts/{account}/homepage` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Homepage" - } - ]; -} - -// Request message for the `UnclaimHomepage` method. -message UnclaimHomepageRequest { - // Required. The name of the homepage to unclaim. - // Format: `accounts/{account}/homepage` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Homepage" - } - ]; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/online_return_policy.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/online_return_policy.proto deleted file mode 100644 index 52c7168b905..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/online_return_policy.proto +++ /dev/null @@ -1,264 +0,0 @@ -// 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/shopping/type/types.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "OnlineReturnPolicyProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// The service facilitates the management of a merchant's remorse return policy -// configuration, encompassing return policies for both ads and free listings -// ## programs. This API defines the following resource model: -// -// [OnlineReturnPolicy][google.shopping.merchant.accounts.v1.OnlineReturnPolicy] -service OnlineReturnPolicyService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Gets an existing return policy. - rpc GetOnlineReturnPolicy(GetOnlineReturnPolicyRequest) - returns (OnlineReturnPolicy) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/onlineReturnPolicies/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all existing return policies. - rpc ListOnlineReturnPolicies(ListOnlineReturnPoliciesRequest) - returns (ListOnlineReturnPoliciesResponse) { - option (google.api.http) = { - get: "/accounts/v1beta/{parent=accounts/*}/onlineReturnPolicies" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for the `GetOnlineReturnPolicy` method. -message GetOnlineReturnPolicyRequest { - // Required. The name of the return policy to retrieve. - // Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/OnlineReturnPolicy" - } - ]; -} - -// Request message for the `ListOnlineReturnPolicies` method. -message ListOnlineReturnPoliciesRequest { - // Required. The merchant account for which to list return policies. - // Format: `accounts/{account}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "merchantapi.googleapis.com/OnlineReturnPolicy" - } - ]; - - // Optional. The maximum number of `OnlineReturnPolicy` resources to return. - // The service returns fewer than this value if the number of return policies - // for the given merchant is less that than the `pageSize`. The default value - // is 10. The maximum value is 100; If a value higher than the maximum is - // specified, then the `pageSize` will default to the maximum - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListOnlineReturnPolicies` - // call. Provide the page token to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListOnlineReturnPolicies` must match the call that provided the page - // token. The token returned as - // [nextPageToken][google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token] - // in the response to the previous request. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for the `ListOnlineReturnPolicies` method. -message ListOnlineReturnPoliciesResponse { - // The retrieved return policies. - repeated OnlineReturnPolicy online_return_policies = 1; - - // A token, which can be sent as `pageToken` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// [Online return policy](https://support.google.com/merchants/answer/10220642) -// object. This is currently used to represent return policies for ads and free -// listings programs. -message OnlineReturnPolicy { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/OnlineReturnPolicy" - pattern: "accounts/{account}/onlineReturnPolicies/{return_policy}" - plural: "onlineReturnPolicies" - singular: "onlineReturnPolicy" - }; - - // The return shipping fee. This can either be a fixed fee or a boolean to - // indicate that the customer pays the actual shipping cost. - message ReturnShippingFee { - // Return shipping fee types. - enum Type { - // Default value. This value is unused. - TYPE_UNSPECIFIED = 0; - - // The return shipping fee is a fixed value. - FIXED = 1; - - // Customers will pay the actual return shipping fee. - CUSTOMER_PAYING_ACTUAL_FEE = 2; - } - - // Type of return shipping fee. - Type type = 1; - - // Fixed return shipping fee amount. This value is only applicable when type - // is `FIXED`. We will treat the return shipping fee as free if type is - // `FIXED` and this value is not set. - google.shopping.type.Price fixed_fee = 2; - } - - // The restocking fee. This can be a flat fee or a micro percent. - message RestockingFee { - oneof type { - // Fixed restocking fee. - google.shopping.type.Price fixed_fee = 1; - - // Percent of total price in micros. 15,000,000 means 15% of the total - // price would be charged. - int32 micro_percent = 2; - } - } - - // The available policies. - message Policy { - // Return policy types. - enum Type { - // Default value. This value is unused. - TYPE_UNSPECIFIED = 0; - - // The number of days within which a return is valid after delivery. - NUMBER_OF_DAYS_AFTER_DELIVERY = 1; - - // No returns. - NO_RETURNS = 2; - - // Life time returns. - LIFETIME_RETURNS = 3; - } - - // Policy type. - Type type = 1; - - // The number of days items can be returned after delivery, where one day - // is defined as 24 hours after the delivery timestamp. Required for - // `NUMBER_OF_DAYS_AFTER_DELIVERY` returns. - int64 days = 2; - } - - // The available return methods. - enum ReturnMethod { - // Default value. This value is unused. - RETURN_METHOD_UNSPECIFIED = 0; - - // Return by mail. - BY_MAIL = 1; - - // Return in store. - IN_STORE = 2; - - // Return at a kiosk. - AT_A_KIOSK = 3; - } - - // The available item conditions. - enum ItemCondition { - // Default value. This value is unused. - ITEM_CONDITION_UNSPECIFIED = 0; - - // New. - NEW = 1; - - // Used. - USED = 2; - } - - // Identifier. The name of the `OnlineReturnPolicy` resource. - // Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. Return policy ID generated by Google. - string return_policy_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // This field represents the unique user-defined label of the return policy. - // It is important to note that the same label cannot be used in different - // return policies for the same country. Unless a product specifies a specific - // label attribute, policies will be automatically labeled as 'default'. - // To assign a custom return policy to certain product groups, follow the - // instructions provided in the [Return policy label] - // (https://support.google.com/merchants/answer/9445425). - // The label can contain up to 50 characters. - string label = 3; - - // The countries of sale where the return policy applies. The values - // must be a valid 2 letter ISO 3166 code. - repeated string countries = 4; - - // The return policy. - Policy policy = 5; - - // The restocking fee that applies to all return reason categories. This would - // be treated as a free restocking fee if the value is not set. - RestockingFee restocking_fee = 6; - - // The return methods of how customers can return an item. This value is - // required to not be empty unless the type of return policy is noReturns. - repeated ReturnMethod return_methods = 7; - - // The item conditions accepted for returns must not be empty unless the type - // of return policy is 'noReturns'. - repeated ItemCondition item_conditions = 8; - - // The return shipping fee. Should be set only when customer need to download - // and print the return label. - ReturnShippingFee return_shipping_fee = 9; - - // The return policy uri. This can used by Google to do a sanity check for the - // policy. It must be a valid URL. - string return_policy_uri = 10; - - // This field specifies if merchant only accepts defective products for - // returns, and this field is required. - optional bool accept_defective_only = 11; - - // The field specifies the number of days it takes for merchants to process - // refunds, field is optional. - optional int32 process_refund_days = 12; - - // This field specifies if merchant allows customers to exchange products, - // this field is required. - optional bool accept_exchange = 13; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto deleted file mode 100644 index 1a55d08ef9e..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/phoneverificationstate.proto +++ /dev/null @@ -1,34 +0,0 @@ -// 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; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "PhoneVerificationStateProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// The phone verification state. -enum PhoneVerificationState { - // Default value. This value is unused. - PHONE_VERIFICATION_STATE_UNSPECIFIED = 0; - - // The phone is verified. - PHONE_VERIFICATION_STATE_VERIFIED = 1; - - // The phone is unverified - PHONE_VERIFICATION_STATE_UNVERIFIED = 2; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/programs.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/programs.proto deleted file mode 100644 index e0f5dcd8782..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/programs.proto +++ /dev/null @@ -1,220 +0,0 @@ -// 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 = "ProgramsProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service for program management. -// -// Programs provide a mechanism for adding functionality to merchant accounts. A -// typical example of this is the [Free product -// listings](https://support.google.com/merchants/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) -// program, which enables products from a merchant's store to be shown across -// Google for free. -// -// This service exposes methods to retrieve a merchant's -// participation in all available programs, in addition to methods for -// explicitly enabling or disabling participation in each program. -service ProgramsService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Retrieves the specified program for the account. - rpc GetProgram(GetProgramRequest) returns (Program) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/programs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Retrieves all programs for the account. - rpc ListPrograms(ListProgramsRequest) returns (ListProgramsResponse) { - option (google.api.http) = { - get: "/accounts/v1beta/{parent=accounts/*}/programs" - }; - option (google.api.method_signature) = "parent"; - } - - // Enable participation in the specified program for the account. Executing - // this method requires admin access. - rpc EnableProgram(EnableProgramRequest) returns (Program) { - option (google.api.http) = { - post: "/accounts/v1beta/{name=accounts/*/programs/*}:enable" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Disable participation in the specified program for the account. Executing - // this method requires admin access. - rpc DisableProgram(DisableProgramRequest) returns (Program) { - option (google.api.http) = { - post: "/accounts/v1beta/{name=accounts/*/programs/*}:disable" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// Defines participation in a given program for the specified account. -// -// Programs provide a mechanism for adding functionality to merchant accounts. A -// typical example of this is the [Free product -// listings](https://support.google.com/merchants/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) -// program, which enables products from a merchant's store to be shown across -// Google for free. -message Program { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/Program" - pattern: "accounts/{account}/programs/{program}" - plural: "programs" - singular: "program" - }; - - // Defines a requirement specified for participation in the program. - message Requirement { - // Output only. Name of the requirement. - string title = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The URL of a help page describing the requirement. - string documentation_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The regions that are currently affected by this requirement - // not being met. - // - // Region codes are defined by [CLDR](https://cldr.unicode.org/). This is - // either a country where the program applies specifically to that country - // or `001` when the program applies globally. - repeated string affected_region_codes = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Possible program participation states for the account. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The account is not eligible to participate in the program. - NOT_ELIGIBLE = 1; - - // The account is eligible to participate in the program. - ELIGIBLE = 2; - - // The program is enabled for the account. - ENABLED = 3; - } - - // Identifier. The resource name of the program. - // Format: `accounts/{account}/programs/{program}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The URL of a Merchant Center help page describing the program. - string documentation_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The participation state of the account in the program. - State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The regions in which the account is actively participating in - // the program. Active regions are defined as those where all program - // requirements affecting the regions have been met. - // - // Region codes are defined by [CLDR](https://cldr.unicode.org/). This is - // either a country where the program applies specifically to that country or - // `001` when the program applies globally. - repeated string active_region_codes = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The requirements that the account has not yet satisfied that - // are affecting participation in the program. - repeated Requirement unmet_requirements = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for the GetProgram method. -message GetProgramRequest { - // Required. The name of the program to retrieve. - // Format: `accounts/{account}/programs/{program}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Program" - } - ]; -} - -// Request message for the ListPrograms method. -message ListProgramsRequest { - // Required. The name of the account for which to retrieve all programs. - // Format: `accounts/{account}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "merchantapi.googleapis.com/Program" - } - ]; - - // Optional. The maximum number of programs to return in a single response. If - // unspecified (or 0), a default size of 1000 is used. The maximum value is - // 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A continuation token, received from a previous `ListPrograms` - // call. Provide this to retrieve the next page. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for the ListPrograms method. -message ListProgramsResponse { - // The programs for the given account. - repeated Program programs = 1; - - // A token that can be sent as `page_token` to retrieve the next page. If this - // field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for the EnableProgram method. -message EnableProgramRequest { - // Required. The name of the program for which to enable participation for the - // given account. Format: `accounts/{account}/programs/{program}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Program" - } - ]; -} - -// Request message for the DisableProgram method. -message DisableProgramRequest { - // Required. The name of the program for which to disable participation for - // the given account. Format: `accounts/{account}/programs/{program}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Program" - } - ]; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/regions.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/regions.proto deleted file mode 100644 index 56a0e5b6453..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/regions.proto +++ /dev/null @@ -1,254 +0,0 @@ -// 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/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/wrappers.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "RegionsProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Manages regions configuration. -// -// This API defines the following resource model: -// -// - [Region][google.shopping.merchant.accounts.v1main.Region] -service RegionsService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Retrieves a region defined in your Merchant Center account. - rpc GetRegion(GetRegionRequest) returns (Region) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/regions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a region definition in your Merchant Center account. Executing this - // method requires admin access. - rpc CreateRegion(CreateRegionRequest) returns (Region) { - option (google.api.http) = { - post: "/accounts/v1beta/{parent=accounts/*}/regions" - body: "region" - }; - option (google.api.method_signature) = "parent,region,region_id"; - } - - // Updates a region definition in your Merchant Center account. Executing this - // method requires admin access. - rpc UpdateRegion(UpdateRegionRequest) returns (Region) { - option (google.api.http) = { - patch: "/accounts/v1beta/{region.name=accounts/*/regions/*}" - body: "region" - }; - option (google.api.method_signature) = "region,update_mask"; - } - - // Deletes a region definition from your Merchant Center account. Executing - // this method requires admin access. - rpc DeleteRegion(DeleteRegionRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/accounts/v1beta/{name=accounts/*/regions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists the regions in your Merchant Center account. - rpc ListRegions(ListRegionsRequest) returns (ListRegionsResponse) { - option (google.api.http) = { - get: "/accounts/v1beta/{parent=accounts/*}/regions" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for the `GetRegion` method. -message GetRegionRequest { - // Required. The name of the region to retrieve. - // Format: `accounts/{account}/regions/{region}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Region" - } - ]; -} - -// Request message for the `CreateRegion` method. -message CreateRegionRequest { - // Required. The account to create a region for. - // Format: `accounts/{account}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; - - // Required. The identifier for the region, unique over all regions of the - // same account. - string region_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The region to create. - Region region = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for the `UpdateRegion` method. -message UpdateRegionRequest { - // Required. The updated region. - Region region = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The comma-separated field mask indicating the fields to update. - // Example: - // `"displayName,postalCodeArea.regionCode"`. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for the `DeleteRegion` method. -message DeleteRegionRequest { - // Required. The name of the region to delete. - // Format: `accounts/{account}/regions/{region}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Region" - } - ]; -} - -// Request message for the `ListRegions` method. -message ListRegionsRequest { - // Required. The account to list regions for. - // Format: `accounts/{account}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; - - // Optional. The maximum number of regions to return. The service may return - // fewer than this value. - // If unspecified, at most 50 regions will be returned. - // The maximum value is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListRegions` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListRegions` must - // match the call that provided the page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for the `ListRegions` method. -message ListRegionsResponse { - // The regions from the specified merchant. - repeated Region regions = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Represents a geographic region that you can use as a target with both the -// `RegionalInventory` and `ShippingSettings` services. You can define regions -// as collections of either postal codes or, in some countries, using predefined -// geotargets. For more information, see [Set up regions -// ](https://support.google.com/merchants/answer/7410946#zippy=%2Ccreate-a-new-region) -// for more information. -message Region { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/Region" - pattern: "accounts/{account}/regions/{region}" - plural: "regions" - singular: "region" - }; - - // A list of postal codes that defines the region area. - // Note: All regions defined using postal codes are accessible through the - // account's `ShippingSettings.postalCodeGroups` resource. - message PostalCodeArea { - // A range of postal codes that defines the region area. - message PostalCodeRange { - // Required. A postal code or a pattern of the form prefix* denoting the - // inclusive lower bound of the range defining the area. Examples values: - // `94108`, `9410*`, `9*`. - string begin = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A postal code or a pattern of the form `prefix*` denoting the - // inclusive upper bound of the range defining the area. It must have the - // same length as postalCodeRangeBegin: if postalCodeRangeBegin is a - // postal code then postalCodeRangeEnd must be a postal code too; if - // postalCodeRangeBegin is a pattern then postalCodeRangeEnd must be a - // pattern with the same prefix length. Optional: if not set, then the - // area is defined as being all the postal codes matching - // postalCodeRangeBegin. - string end = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. [CLDR territory - // code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) - // or the country the postal code group applies to. - string region_code = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A range of postal codes. - repeated PostalCodeRange postal_codes = 2 - [(google.api.field_behavior) = REQUIRED]; - } - - // A list of geotargets that defines the region area. - message GeoTargetArea { - // Required. A non-empty list of [location - // IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). - // They must all be of the same location type (for example, state). - repeated int64 geotarget_criteria_ids = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // Identifier. The resource name of the region. - // Format: `accounts/{account}/regions/{region}` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. The display name of the region. - optional string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of postal codes that defines the region area. - PostalCodeArea postal_code_area = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of geotargets that defines the region area. - GeoTargetArea geotarget_area = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Indicates if the region is eligible for use in the Regional - // Inventory configuration. - google.protobuf.BoolValue regional_inventory_eligible = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Indicates if the region is eligible for use in the Shipping - // Services configuration. - google.protobuf.BoolValue shipping_eligible = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto deleted file mode 100644 index a7fac4a8a24..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/shippingsettings.proto +++ /dev/null @@ -1,719 +0,0 @@ -// 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/shopping/type/types.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "ShippingSettingsProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to get method call shipping setting information per Merchant API -// method. -service ShippingSettingsService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Retrieve shipping setting information. - rpc GetShippingSettings(GetShippingSettingsRequest) - returns (ShippingSettings) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/shippingSettings}" - }; - option (google.api.method_signature) = "name"; - } - - // Replace the shipping setting of a merchant with the request shipping - // setting. Executing this method requires admin access. - rpc InsertShippingSettings(InsertShippingSettingsRequest) - returns (ShippingSettings) { - option (google.api.http) = { - post: "/accounts/v1beta/{parent=accounts/*}/shippingSettings:insert" - body: "shipping_setting" - }; - } -} - -// The merchant account's [shipping -// setting](https://support.google.com/merchants/answer/6069284). -message ShippingSettings { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/ShippingSettings" - pattern: "accounts/{account}/shippingSettings" - plural: "shippingSettings" - singular: "shippingSettings" - }; - - // Identifier. The resource name of the shipping setting. - // Format: `accounts/{account}/shippingSetting` - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Optional. The target account's list of services. - repeated Service services = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of warehouses which can be referred to in `services`. - repeated Warehouse warehouses = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. This field is used for avoid async issue. Make sure shipping - // setting data - // didn't change between get call and insert call. The user should do - // following steps: - // - // 1. Set etag field as empty string for initial shipping setting creation. - // - // 2. After initial creation, call get method to obtain an etag and current - // shipping setting data before call insert. - // - // 3. Modify to wanted shipping setting information. - // - // 4. Call insert method with the wanted shipping setting information with - // the etag obtained from step 2. - // - // 5. If shipping setting data changed between step 2 and step 4. Insert - // request will fail because the etag changes every time the shipping setting - // data changes. User should repeate step 2-4 with the new etag. - string etag = 4 [(google.api.field_behavior) = REQUIRED]; -} - -// Shipping service. -message Service { - // A list of stores your products are delivered from. - // This is only valid for the local delivery shipment type. - message StoreConfig { - // Configs related to local delivery ends for the day. - message CutoffConfig { - // Time that local delivery ends for the day. - message LocalCutoffTime { - // Hour local delivery orders must be placed by to process the same - // day. - optional int64 hour = 1; - - // Minute local delivery orders must be placed by to process the same - // day. - optional int64 minute = 2; - } - - // Time that local delivery ends for the day. - optional LocalCutoffTime local_cutoff_time = 1; - - // Only valid with local delivery fulfillment. Represents cutoff time - // as the number of hours before store closing. Mutually exclusive - // with `local_cutoff_time`. - optional int64 store_close_offset_hours = 2; - - // Merchants can opt-out of showing n+1 day local delivery when they have - // a shipping service configured to n day local delivery. For example, if - // the shipping service defines same-day delivery, and it's past the - // cut-off, setting this field to `true` results in the calculated - // shipping service rate returning `NO_DELIVERY_POST_CUTOFF`. In the - // same example, setting this field to `false` results in the calculated - // shipping time being one day. This is only for local delivery. - optional bool no_delivery_post_cutoff = 3; - } - - // Indicates whether all stores, or selected stores, listed by the - // merchant provide local delivery. - enum StoreServiceType { - // Did not specify store service type. - STORE_SERVICE_TYPE_UNSPECIFIED = 0; - - // Indicates whether all stores, current and future, listed by this - // merchant provide local delivery. - ALL_STORES = 1; - - // Indicates that only the stores listed in `store_codes` are eligible - // for local delivery. - SELECTED_STORES = 2; - } - - // Indicates whether all stores, or selected stores, listed by this - // merchant provide local delivery. - optional StoreServiceType store_service_type = 1; - - // Optional. A list of store codes that provide local delivery. - // If empty, then `all_stores` must be true. - repeated string store_codes = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Configs related to local delivery ends for the day. - optional CutoffConfig cutoff_config = 3; - - // Maximum delivery radius. - // This is only required for the local delivery shipment type. - optional Distance service_radius = 4; - } - - // [Loyalty program](https://support.google.com/merchants/answer/12922446) - // provided by a merchant. - message LoyaltyProgram { - // Subset of a merchants loyalty program. - message LoyaltyProgramTiers { - // The tier label [tier_label] sub-attribute differentiates offer level - // benefits between each tier. This value is also set in your program - // settings in Merchant Center, and is required for data source changes - // even if your loyalty program only has 1 tier. - optional string tier_label = 1; - } - - // This is the loyalty program label set in your loyalty program settings in - // Merchant Center. This sub-attribute allows Google to map your loyalty - // program to eligible offers. - optional string program_label = 1; - - // Optional. Loyalty program tier of this shipping service. - repeated LoyaltyProgramTiers loyalty_program_tiers = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Shipment type of shipping service. - enum ShipmentType { - // This service did not specify shipment type. - SHIPMENT_TYPE_UNSPECIFIED = 0; - - // This service ships orders to an address chosen by the customer. - DELIVERY = 1; - - // This service ships orders to an address chosen by the customer. - // The order is shipped from a local store near by. - LOCAL_DELIVERY = 2; - - // This service ships orders to an address chosen by the customer. - // The order is shipped from a collection point. - COLLECTION_POINT = 3; - } - - // Required. Free-form name of the service. Must be unique within target - // account. - optional string service_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A boolean exposing the active status of the shipping service. - optional bool active = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The CLDR territory code of the countries to which the service - // applies. - repeated string delivery_countries = 3 - [(google.api.field_behavior) = REQUIRED]; - - // The CLDR code of the currency to which this service applies. Must match - // that of the prices in rate groups. - optional string currency_code = 4; - - // Required. Time spent in various aspects from order to the delivery of the - // product. - optional DeliveryTime delivery_time = 5 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Shipping rate group definitions. Only the last one is allowed to - // have an empty `applicable_shipping_labels`, which means "everything else". - // The other `applicable_shipping_labels` must not overlap. - repeated RateGroup rate_groups = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Type of locations this service ships orders to. - optional ShipmentType shipment_type = 7; - - // Minimum order value for this service. If set, indicates that customers - // will have to spend at least this amount. - // All prices within a service must have the same currency. - // Cannot be set together with minimum_order_value_table. - optional google.shopping.type.Price minimum_order_value = 8; - - // Table of per store minimum order values for the pickup fulfillment type. - // Cannot be set together with minimum_order_value. - optional MinimumOrderValueTable minimum_order_value_table = 9; - - // A list of stores your products are delivered from. - // This is only valid for the local delivery shipment type. - optional StoreConfig store_config = 10; - - // Optional. Loyalty programs that this shipping service is limited to. - repeated LoyaltyProgram loyalty_programs = 11 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Maximum delivery radius. -// This is only required for the local delivery shipment type. -message Distance { - // Unit can differ based on country, it is parameterized to include miles - // and kilometers. - enum Unit { - // Unit unspecified - UNIT_UNSPECIFIED = 0; - - // Unit in miles - MILES = 1; - - // Unit in kilometers - KILOMETERS = 2; - } - - // Integer value of distance. - optional int64 value = 1; - - // Unit can differ based on country, it is parameterized to include miles - // and kilometers. - optional Unit unit = 2; -} - -// A fulfillment warehouse, which stores and handles inventory. -// Next tag: 7 -message Warehouse { - // Required. The name of the warehouse. Must be unique within account. - optional string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Shipping address of the warehouse. - optional Address shipping_address = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The latest time of day that an order can be accepted and begin - // processing. Later orders will be processed in the next day. The time is - // based on the warehouse postal code. - optional WarehouseCutoffTime cutoff_time = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The number of days it takes for this warehouse to pack up and - // ship an item. This is on the warehouse level, but can be overridden on the - // offer level based on the attributes of an item. - optional int64 handling_days = 4 [(google.api.field_behavior) = REQUIRED]; - - // Business days of the warehouse. - // If not set, will be Monday to Friday by default. - optional BusinessDayConfig business_day_config = 5; -} - -// The latest time of day that an order can be accepted and begin processing. -// Later orders will be processed in the next day. The time is based on the -// warehouse postal code. -message WarehouseCutoffTime { - // Required. Hour of the cutoff time until which an order has to be placed to - // be processed in the same day by the warehouse. Hour is based on the - // timezone of warehouse. - optional int32 hour = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Minute of the cutoff time until which an order has to be placed - // to be processed in the same day by the warehouse. Minute is based on the - // timezone of warehouse. - optional int32 minute = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Shipping address of the warehouse. -message Address { - // Street-level part of the address. For example: `111w 31st Street`. - optional string street_address = 1; - - // Required. City, town or commune. May also include dependent localities or - // sublocalities (For example neighborhoods or suburbs). - optional string city = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Top-level administrative subdivision of the country. For example, - // a state like California ("CA") or a province like Quebec ("QC"). - optional string administrative_area = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Postal code or ZIP (For example "94043"). - optional string postal_code = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. [CLDR country - // code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml) - // (For example "US"). - optional string region_code = 5 [(google.api.field_behavior) = REQUIRED]; -} - -// Time spent in various aspects from order to the delivery of the product. -message DeliveryTime { - // Minimum number of business days that is spent in transit. 0 means same - // day delivery, 1 means next day delivery. - // Either `min_transit_days`, `max_transit_days` or - // `transit_time_table` must be set, but not both. - optional int32 min_transit_days = 1; - - // Maximum number of business days that is spent in transit. 0 means same - // day delivery, 1 means next day delivery. Must be greater than or equal - // to `min_transit_days`. - optional int32 max_transit_days = 2; - - // Business days cutoff time definition. - // If not configured the cutoff time will be defaulted to 8AM PST. - optional CutoffTime cutoff_time = 3; - - // 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 - // and column dimensions. Either `min_transit_days`, `max_transit_days` or - // `transit_time_table` can be set, but not both. - optional TransitTable transit_time_table = 6; - - // The business days during which orders can be handled. - // If not provided, Monday to Friday business days will be assumed. - optional BusinessDayConfig handling_business_day_config = 7; - - // The business days during which orders can be in-transit. - // If not provided, Monday to Friday business days will be assumed. - optional BusinessDayConfig transit_business_day_config = 8; - - // Optional. Indicates that the delivery time should be calculated per - // warehouse (shipping origin location) based on the settings of the selected - // carrier. When set, no other transit time related field in [delivery - // time][[google.shopping.content.bundles.ShippingSetting.DeliveryTime] should - // be set. - repeated WarehouseBasedDeliveryTime warehouse_based_delivery_times = 9 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Business days cutoff time definition. -message CutoffTime { - // Required. Hour of the cutoff time until which an order has to be placed to - // be processed in the same day. - optional int32 hour = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Minute of the cutoff time until which an order has to be placed - // to be processed in the same day. - optional int32 minute = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. [Timezone - // identifier](https://developers.google.com/adwords/api/docs/appendix/codes-formats#timezone-ids) - // For example "Europe/Zurich". - optional string time_zone = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Business days of the warehouse. -message BusinessDayConfig { - enum Weekday { - WEEKDAY_UNSPECIFIED = 0; - - MONDAY = 1; - - TUESDAY = 2; - - WEDNESDAY = 3; - - THURSDAY = 4; - - FRIDAY = 5; - - SATURDAY = 6; - - SUNDAY = 7; - } - - // Required. Regular business days. - // May not be empty. - repeated Weekday business_days = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Indicates that the delivery time should be calculated per warehouse -// (shipping origin location) based on the settings of the selected carrier. -// When set, no other transit time related field in `delivery_time` should be -// set. -message WarehouseBasedDeliveryTime { - // Required. Carrier, such as `"UPS"` or `"Fedex"`. - optional string carrier = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Carrier service, such as `"ground"` or `"2 days"`. The name of - // the service must be in the eddSupportedServices list. - optional string carrier_service = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Warehouse name. This should match - // [warehouse][ShippingSetting.warehouses.name] - optional string warehouse = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Shipping rate group definitions. Only the last one is allowed to have an -// empty `applicable_shipping_labels`, which means -// "everything else". The other `applicable_shipping_labels` must -// not overlap. -message RateGroup { - // Required. A list of [shipping - // labels](https://support.google.com/merchants/answer/6324504) defining the - // products to which this rate group applies to. This is a disjunction: only - // one of the labels has to match for the rate group to apply. May only be - // empty for the last rate group of a service. - repeated string applicable_shipping_labels = 1 - [(google.api.field_behavior) = REQUIRED]; - - // The value of the rate group (For example flat rate $10). Can only be set - // if `main_table` and `subtables` are not set. - optional Value single_value = 2; - - // A table defining the rate group, when `single_value` is not - // expressive enough. Can only be set if `single_value` is not - // set. - optional Table main_table = 3; - - // Optional. A list of subtables referred to by `main_table`. Can only - // be set if `main_table` is set. - repeated Table subtables = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of carrier rates that can be referred to by - // `main_table` or `single_value`. - repeated CarrierRate carrier_rates = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Name of the rate group. - // If set has to be unique within shipping service. - optional string name = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// A table defining the rate group, when `single_value` is not -// expressive enough. -message Table { - // Name of the table. Required for subtables, ignored for the main table. - optional string name = 1; - - // Required. Headers of the table's rows. - optional Headers row_headers = 2 [(google.api.field_behavior) = REQUIRED]; - - // Headers of the table's columns. Optional: if not set then the table has - // only one dimension. - optional Headers column_headers = 3; - - // Required. The list of rows that constitute the table. Must have the same - // length as `row_headers`. - repeated Row rows = 4 [(google.api.field_behavior) = REQUIRED]; -} - -// Transit time table, number of business days spent in transit based on row -// and column dimensions. Either `min_transit_days`, `max_transit_days` or -// `transit_time_table` can be set, but not both. -message TransitTable { - // If there's only one dimension set of `postal_code_group_names` or - // `transit_time_labels`, there are multiple rows each with one value - // for that dimension. If there are two dimensions, each row corresponds to a - // `postal_code_group_names`, and columns (values) to a - // `transit_time_labels`. - message TransitTimeRow { - // Transit time range (min-max) in business days. - message TransitTimeValue { - // Minimum transit time range in business days. 0 means same - // day delivery, 1 means next day delivery. - optional int32 min_transit_days = 1; - - // Must be greater than or equal to `min_transit_days`. - optional int32 max_transit_days = 2; - } - - // Required. Transit time range (min-max) in business days. - repeated TransitTimeValue values = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // Required. A list of region names - // [Region.name][google.shopping.merchant.accounts.v1beta.Region.name] . The - // last value can be - // `"all other locations"`. Example: - // `["zone 1", "zone 2", "all other locations"]`. The referred - // postal code groups must match the delivery country of the service. - repeated string postal_code_group_names = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of transit time labels. The last value can be - // `"all other labels"`. Example: - // `["food", "electronics", "all other labels"]`. - repeated string transit_time_labels = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. If there's only one dimension set of `postal_code_group_names` or - // `transit_time_labels`, there are multiple rows each with one value - // for that dimension. If there are two dimensions, each row corresponds to a - // `postal_code_group_names`, and columns (values) to a - // `transit_time_labels`. - repeated TransitTimeRow rows = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Table of per store minimum order values for the pickup fulfillment type. -message MinimumOrderValueTable { - // A list of store code sets sharing the same minimum order value. At least - // two sets are required and the last one must be empty, which signifies - // 'MOV for all other stores'. - // Each store code can only appear once across all the sets. - // All prices within a service must have the same currency. - message StoreCodeSetWithMov { - // Optional. A list of unique store codes or empty for the catch all. - repeated string store_codes = 1 [(google.api.field_behavior) = OPTIONAL]; - - // The minimum order value for the given stores. - optional google.shopping.type.Price value = 2; - } - - // Required. A list of store code sets sharing the same minimum order value - // (MOV). At least two sets are required and the last one must be empty, which - // signifies 'MOV for all other stores'. Each store code can only appear once - // across all the sets. All prices within a service must have the same - // currency. - repeated StoreCodeSetWithMov store_code_set_with_movs = 1 - [(google.api.field_behavior) = REQUIRED]; -} - -// A non-empty list of row or column headers for a table. -// Exactly one of `prices`, `weights`, -// `num_items`, `postal_code_group_names`, or -// `location` must be set. -message Headers { - // Required. A list of inclusive order price upper bounds. The last price's - // value can be infinity by setting price amount_micros = -1. For example - // `[{"amount_micros": 10000000, "currency_code": "USD"}, - // {"amount_micros": 500000000, "currency_code": "USD"}, - // {"amount_micros": -1, "currency_code": "USD"}]` represents the headers - // "<= $10", "<= $500", and "> $500". All prices within a service must have - // the same currency. Must be non-empty. Must be positive except -1. Can only - // be set if all other fields are not set. - repeated google.shopping.type.Price prices = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of inclusive order weight upper bounds. The last weight's - // value can be infinity by setting price amount_micros = -1. For example - // `[{"amount_micros": 10000000, "unit": "kg"}, {"amount_micros": 50000000, - // "unit": "kg"}, - // {"amount_micros": -1, "unit": "kg"}]` represents the headers - // "<= 10kg", "<= 50kg", and "> 50kg". All weights within a service must have - // the same unit. Must be non-empty. Must be positive except -1. Can only be - // set if all other fields are not set. - repeated google.shopping.type.Weight weights = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of inclusive number of items upper bounds. The last value - // can be - // `"infinity"`. For example - // `["10", "50", "infinity"]` represents the headers - // "<= 10 items", "<= 50 items", and "> 50 items". Must be non-empty. Can - // only be set if all other fields are not set. - repeated string number_of_items = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of postal group names. The last value can be - // `"all other locations"`. Example: - // `["zone 1", "zone 2", "all other locations"]`. The referred - // postal code groups must match the delivery country of the service. Must - // be non-empty. Can only be set if all other fields are not set. - repeated string postal_code_group_names = 4 - [(google.api.field_behavior) = REQUIRED]; - - // Required. A list of location ID sets. Must be non-empty. Can only be set if - // all other fields are not set. - repeated LocationIdSet locations = 5 [(google.api.field_behavior) = REQUIRED]; -} - -// A list of location ID sets. Must be non-empty. Can only be set if all -// other fields are not set. -message LocationIdSet { - // Required. A non-empty list of - // [location - // IDs](https://developers.google.com/adwords/api/docs/appendix/geotargeting). - // They must all be of the same location type (For - // example, state). - repeated string location_ids = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Include a list of cells. -message Row { - // Required. The list of cells that constitute the row. Must have the same - // length as `columnHeaders` for two-dimensional tables, a length of 1 for - // one-dimensional tables. - repeated Value cells = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The single value of a rate group or the value of a rate group table's cell. -// Exactly one of `no_shipping`, `flat_rate`, -// `price_percentage`, `carrier_rateName`, -// `subtable_name` must be set. -message Value { - // If true, then the product can't be shipped. Must be true when set, can only - // be set if all other fields are not set. - optional bool no_shipping = 1; - - // A flat rate. Can only be set if all other fields are not set. - optional google.shopping.type.Price flat_rate = 2; - - // A percentage of the price represented as a number in decimal notation - // (For example, `"5.4"`). Can only be set if all other fields are not - // set. - optional string price_percentage = 3; - - // The name of a carrier rate referring to a carrier rate defined in the - // same rate group. Can only be set if all other fields are not set. - optional string carrier_rate = 4; - - // The name of a subtable. Can only be set in table cells (For example, not - // for single values), and only if all other fields are not set. - optional string subtable = 5; -} - -// A list of carrier rates that can be referred to by -// `main_table` or `single_value`. -message CarrierRate { - // Required. Name of the carrier rate. Must be unique per rate group. - optional string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Carrier service, such as `"UPS"` or `"Fedex"`. - optional string carrier = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Carrier service, such as `"ground"` or `"2 days"`. - optional string carrier_service = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. Shipping origin for this carrier rate. - optional string origin_postal_code = 4 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Multiplicative shipping rate modifier as a number in decimal - // notation. Can be negative. For example `"5.4"` increases the rate by 5.4%, - // `"-3"` decreases the rate by 3%. - optional string percentage_adjustment = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Additive shipping rate modifier. Can be negative. For example - // `{ "amount_micros": 1, "currency_code" : "USD" }` adds $1 to the rate, - // `{ "amount_micros": -3, "currency_code" : "USD" }` removes $3 from the - // rate. - optional google.shopping.type.Price flat_adjustment = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for the `GetShippingSetting` method. -message GetShippingSettingsRequest { - // Required. The name of the shipping setting to retrieve. - // Format: `accounts/{account}/shippingsetting` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/ShippingSettings" - } - ]; -} - -// Request message for the `InsertShippingSetting` method. -message InsertShippingSettingsRequest { - // Required. The account where this product will be inserted. - // Format: accounts/{account} - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The new version of the account. - ShippingSettings shipping_setting = 2 - [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/tax_rule.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/tax_rule.proto deleted file mode 100644 index a3217675d9d..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/tax_rule.proto +++ /dev/null @@ -1,87 +0,0 @@ -// 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/field_behavior.proto"; -import "google/type/interval.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "TaxRuleProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Primary type convension -// -// percent micro : 100% = 1 000 000 and 1% = 10 000 -// cannot be negative. -// -// Information about tax nexus and related parameters applicable to orders -// delivered to the area covered by a single tax admin. Nexus is created when a -// merchant is doing business in an area administered by tax admin (only US -// states are supported for nexus configuration). If merchant has nexus in a US -// state, merchant needs to pay tax to all tax authorities associated with -// the shipping destination. -// Next Id : 8 -message TaxRule { - // A range of postal codes that defines the area. - message TaxPostalCodeRange { - // Required. The start of the postal code range, which is also the smallest - // in the range. - string start = 1 [(google.api.field_behavior) = REQUIRED]; - - // The end of the postal code range. Will be the same as start if not - // specified. - string end = 2; - } - - // Describe the location through either postal code range or a criteria id. - oneof location { - // The admin_id or criteria_id of the region in which this rule is - // applicable. - int64 location_id = 2; - - // The range of postal codes in which this rule is applicable. - TaxPostalCodeRange post_code_range = 3; - } - - // What is the way to calculate tax rate for deliveries to this admin's area. - // Can only be set on US states. - oneof rate_calculation { - // Rate that depends on delivery location: if merchant has a nexus in - // corresponding US state, rates from authorities with jurisdiction over - // delivery area are added up. - bool use_google_rate = 4; - - // A fixed rate specified in micros, where 100% = 1_000_000. - // Suitable for origin-based states. - int64 self_specified_rate_micros = 5; - } - - // Region code in which this rule is applicable - string region_code = 1; - - // If set, shipping charge is taxed (at the same rate as product) when - // delivering to this admin's area. - // Can only be set on US states without category. - bool shipping_taxed = 6; - - // Required. Time period when this rule is effective. If the duration is - // missing from effective_time listed, then it is open ended to the future. - // The start of this time period is inclusive, and the end is exclusive. - google.type.Interval effective_time_period = 7 - [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto deleted file mode 100644 index 86c0c37aaaf..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservice.proto +++ /dev/null @@ -1,145 +0,0 @@ -// 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/empty.proto"; -import "google/shopping/merchant/accounts/v1beta/termsofservicekind.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "TermsOfServiceProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to support `TermsOfService` API. -service TermsOfServiceService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Retrieves the `TermsOfService` associated with the provided version. - rpc GetTermsOfService(GetTermsOfServiceRequest) returns (TermsOfService) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=termsOfService/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Retrieves the latest version of the `TermsOfService` for a given `kind` and - // `region_code`. - rpc RetrieveLatestTermsOfService(RetrieveLatestTermsOfServiceRequest) - returns (TermsOfService) { - option (google.api.http) = { - get: "/accounts/v1beta/termsOfService:retrieveLatest" - }; - } - - // Accepts a `TermsOfService`. Executing this method requires admin access. - rpc AcceptTermsOfService(AcceptTermsOfServiceRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=termsOfService/*}:accept" - }; - option (google.api.method_signature) = "name"; - } -} - -// A `TermsOfService`. -message TermsOfService { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/TermsOfService" - pattern: "termsOfService/{version}" - }; - - // Identifier. The resource name of the terms of service version. - // Format: `termsOfService/{version}` - string name = 1 [ - (google.api.field_behavior) = IDENTIFIER, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/TermsOfService" - } - ]; - - // Region code as defined by [CLDR](https://cldr.unicode.org/). This is either - // a country where the ToS applies specifically to that country or `001` when - // the same `TermsOfService` can be signed in any country. However note that - // when signing a ToS that applies globally we still expect that a specific - // country is provided (this should be merchant business country or program - // country of participation). - string region_code = 2; - - // The Kind this terms of service version applies to. - TermsOfServiceKind kind = 3; - - // URI for terms of service file that needs to be displayed to signing users. - optional string file_uri = 4; - - // Whether this terms of service version is external. External terms of - // service versions can only be agreed through external processes and not - // directly by the merchant through UI or API. - bool external = 5; -} - -// Request message for the `GetTermsOfService` method. -message GetTermsOfServiceRequest { - // Required. The resource name of the terms of service version. - // Format: `termsOfService/{version}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/TermsOfService" - } - ]; -} - -// Request message for the `RetrieveLatestTermsOfService` method. -message RetrieveLatestTermsOfServiceRequest { - // 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]; - - // Required. The Kind this terms of service version applies to. - TermsOfServiceKind kind = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for the `AcceptTermsOfService` method. -message AcceptTermsOfServiceRequest { - // Required. The resource name of the terms of service version. - // Format: `termsOfService/{version}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/TermsOfService" - } - ]; - - // Required. The account for which to accept the ToS. - string account = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; - - // 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 = 3 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto deleted file mode 100644 index df3d93436d2..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofserviceagreementstate.proto +++ /dev/null @@ -1,169 +0,0 @@ -// 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/shopping/merchant/accounts/v1beta/termsofservicekind.proto"; -import "google/type/date.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "TermsOfServiceAgreementStateProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to support `TermsOfServiceAgreementState` API. -service TermsOfServiceAgreementStateService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Returns the state of a terms of service agreement. - rpc GetTermsOfServiceAgreementState(GetTermsOfServiceAgreementStateRequest) - returns (TermsOfServiceAgreementState) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/termsOfServiceAgreementStates/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Retrieves the state of the agreement for the application terms of service. - rpc RetrieveForApplicationTermsOfServiceAgreementState( - RetrieveForApplicationTermsOfServiceAgreementStateRequest) - returns (TermsOfServiceAgreementState) { - option (google.api.http) = { - get: "/accounts/v1beta/{parent=accounts/*}/termsOfServiceAgreementStates:retrieveForApplication" - }; - option (google.api.method_signature) = "parent"; - } -} - -// This resource represents the agreement state for a given account and terms of -// service kind. -// The state is as follows: -// -// * If the merchant has accepted a terms of service: -// [accepted](TermsOfServiceAggrementState.accepted) will be populated, -// otherwise it will be empty -// * If the merchant must sign a terms of service: -// [required](TermsOfServiceAggrementState.required) will be populated, -// otherwise it will be empty. -// -// Note that both [required](TermsOfServiceAggrementState.required) and -// [accepted](TermsOfServiceAggrementState.accepted) can be present. In this -// case the `accepted` terms of services will have an expiration date set in the -// [valid_until](Accepted.valid_until) field. The `required` terms of services -// need to be accepted before `valid_until` in order for the account to continue -// having a valid agreement. When accepting new terms of services we expect 3Ps -// to display the text associated with the given terms of service agreement (the -// url to the file containing the text is added in the Required message below as -// [tos_file_uri](Accepted.tos_file_uri). The actual acceptance of the terms of -// service is done by calling accept on the [TermsOfService](TermsOfService) -// resource. -message TermsOfServiceAgreementState { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/TermsOfServiceAgreementState" - pattern: "accounts/{account}/termsOfServiceAgreementStates/{identifier}" - plural: "termsOfServiceAgreementStates" - singular: "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 - // country the current state applies to. - string region_code = 2; - - // Terms of Service kind associated with the particular version. - TermsOfServiceKind terms_of_service_kind = 3; - - // The accepted terms of service of this kind and for the associated - // region_code - optional Accepted accepted = 4; - - // The required terms of service - optional Required required = 5; -} - -// Describes the accepted terms of service. -message Accepted { - // The accepted - // [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService). - string terms_of_service = 1 [(google.api.resource_reference) = { - type: "merchantapi.googleapis.com/TermsOfService" - }]; - - // The account where the acceptance was recorded. This can be the account - // itself or, in the case of subaccounts, the MCA account. - string accepted_by = 2 [(google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - }]; - - // When set, it states that the accepted - // [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) - // is only valid until the end of this date (in UTC). A new one must be - // accepted before then. The information of the required - // [TermsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) - // is found in the [Required](Required) message. - optional google.type.Date valid_until = 3; -} - -// Describes the terms of service which are required to be accepted. -message Required { - // The - // [termsOfService](google.shopping.merchant.accounts.v1main.TermsOfService) - // that need to be accepted. - string terms_of_service = 1 [(google.api.resource_reference) = { - type: "merchantapi.googleapis.com/TermsOfService" - }]; - - // Full URL to the terms of service file. This field is the same as - // [TermsOfService.file_uri](TermsOfService.file_uri), it is added - // here for convenience only. - string tos_file_uri = 2; -} - -// Request message for the `GetTermsOfServiceAgreementState` method. -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) = { - type: "merchantapi.googleapis.com/TermsOfServiceAgreementState" - } - ]; -} - -// Request message for the `RetrieveForApplicationTermsOfServiceAgreementState` -// method. -message RetrieveForApplicationTermsOfServiceAgreementStateRequest { - // Required. The account for which to get a TermsOfServiceAgreementState - // Format: `accounts/{account}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "merchantapi.googleapis.com/TermsOfServiceAgreementState" - } - ]; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservicekind.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservicekind.proto deleted file mode 100644 index 96848981d7e..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/termsofservicekind.proto +++ /dev/null @@ -1,31 +0,0 @@ -// 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; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "TermsOfServiceKindProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// The TermsOfService Kind. -enum TermsOfServiceKind { - // Default value. This value is unused. - TERMS_OF_SERVICE_KIND_UNSPECIFIED = 0; - - // Merchant Center application. - MERCHANT_CENTER = 1; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/user.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/user.proto deleted file mode 100644 index 7f4d2bb3cb8..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/user.proto +++ /dev/null @@ -1,217 +0,0 @@ -// 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/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/shopping/merchant/accounts/v1beta/accessright.proto"; - -option go_package = "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb"; -option java_multiple_files = true; -option java_outer_classname = "UserProto"; -option java_package = "com.google.shopping.merchant.accounts.v1beta"; - -// Service to support user API. -service UserService { - option (google.api.default_host) = "merchantapi.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; - - // Retrieves a Merchant Center account user. - rpc GetUser(GetUserRequest) returns (User) { - option (google.api.http) = { - get: "/accounts/v1beta/{name=accounts/*/users/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a Merchant Center account user. Executing this method requires - // admin access. - rpc CreateUser(CreateUserRequest) returns (User) { - option (google.api.http) = { - post: "/accounts/v1beta/{parent=accounts/*}/users" - body: "user" - }; - option (google.api.method_signature) = "parent,user"; - } - - // Deletes a Merchant Center account user. Executing this method requires - // admin access. - rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/accounts/v1beta/{name=accounts/*/users/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a Merchant Center account user. Executing this method requires - // admin access. - rpc UpdateUser(UpdateUserRequest) returns (User) { - option (google.api.http) = { - patch: "/accounts/v1beta/{user.name=accounts/*/users/*}" - body: "user" - }; - option (google.api.method_signature) = "user,update_mask"; - } - - // Lists all users of a Merchant Center account. - rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { - option (google.api.http) = { - get: "/accounts/v1beta/{parent=accounts/*}/users" - }; - option (google.api.method_signature) = "parent"; - } -} - -// A [user](https://support.google.com/merchants/answer/12160472). -message User { - option (google.api.resource) = { - type: "merchantapi.googleapis.com/User" - pattern: "accounts/{account}/users/{email}" - plural: "users" - singular: "user" - }; - - // The possible states of a user. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The user is pending confirmation. In this state, the user first needs to - // accept the invitation before performing other actions. - PENDING = 1; - - // The user is verified. - VERIFIED = 2; - } - - // Identifier. The resource name of the user. - // Format: `accounts/{account}/user/{email}` - // - // Use `me` to refer to your own email address, for example - // `accounts/{account}/users/me`. - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The state of the user. - State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The [access - // rights](https://support.google.com/merchants/answer/12160472?sjid=6789834943175119429-EU#accesstypes) - // the user has. - repeated AccessRight access_rights = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for the `GetUser` method. -message GetUserRequest { - // Required. The name of the user to retrieve. - // Format: `accounts/{account}/users/{email}` - // - // It is also possible to retrieve the user corresponding to the caller by - // using `me` rather than an email address as in - // `accounts/{account}/users/me`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/User" - } - ]; -} - -// Request message for the `CreateUser` method. -message CreateUserRequest { - // Required. The resource name of the account for which a user will be - // created. Format: `accounts/{account}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; - - // Required. The email address of the user (for example, - // `john.doe@gmail.com`). - string user_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The user to create. - User user = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for the `DeleteUser` method. -message DeleteUserRequest { - // Required. The name of the user to delete. - // Format: `accounts/{account}/users/{email}` - // - // It is also possible to delete the user corresponding to the caller by using - // `me` rather than an email address as in `accounts/{account}/users/me`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/User" - } - ]; -} - -// Request message for the `UpdateUser` method. -message UpdateUserRequest { - // Required. The new version of the user. - // - // Use `me` to refer to your own email address, for example - // `accounts/{account}/users/me`. - User user = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. List of fields being updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for the `ListUsers` method. -message ListUsersRequest { - // Required. The parent, which owns this collection of users. - // Format: `accounts/{account}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "merchantapi.googleapis.com/Account" - } - ]; - - // Optional. The maximum number of users to return. The service may return - // fewer than this value. If unspecified, at most 50 users will be returned. - // The maximum value is 100; values above 100 will be coerced to 100 - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListUsers` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListUsers` must match - // the call that provided the page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for the `ListUsers` method. -message ListUsersResponse { - // The users from the specified account. - repeated User users = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/type/types.proto b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/type/types.proto deleted file mode 100644 index 0d219e72d6a..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/type/types.proto +++ /dev/null @@ -1,193 +0,0 @@ -// 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.type; - -option csharp_namespace = "Google.Shopping.Type"; -option go_package = "cloud.google.com/go/shopping/type/typepb;typepb"; -option java_multiple_files = true; -option java_outer_classname = "TypesProto"; -option java_package = "com.google.shopping.type"; - -// The weight represented as the value in string and the unit. -message Weight { - // The weight unit. - enum WeightUnit { - // unit unspecified - WEIGHT_UNIT_UNSPECIFIED = 0; - - // lb unit. - POUND = 1; - - // kg unit. - KILOGRAM = 2; - } - - // Required. The weight represented as a number in micros (1 million micros is - // an equivalent to one's currency standard unit, for example, 1 kg = 1000000 - // micros). - // This field can also be set as infinity by setting to -1. - // This field only support -1 and positive value. - optional int64 amount_micros = 1; - - // Required. The weight unit. - // Acceptable values are: kg and lb - WeightUnit unit = 2; -} - -// The price represented as a number and currency. -message Price { - // The price represented as a number in micros (1 million micros is an - // equivalent to one's currency standard unit, for example, 1 USD = 1000000 - // micros). - optional int64 amount_micros = 1; - - // The currency of the price using three-letter acronyms according to [ISO - // 4217](http://en.wikipedia.org/wiki/ISO_4217). - optional string currency_code = 2; -} - -// A message that represents custom attributes. Exactly one of `value` or -// `group_values` must not be empty. -message CustomAttribute { - // The name of the attribute. - optional string name = 1; - - // The value of the attribute. If `value` is not empty, `group_values` must be - // empty. - optional string value = 2; - - // Subattributes within this attribute group. If - // `group_values` is not empty, `value` must be empty. - repeated CustomAttribute group_values = 3; -} - -// Destinations available for a product. -// -// Destinations are used in Merchant Center to allow you to control where the -// products from your data feed should be displayed. -// -message Destination { - // Destination values. - enum DestinationEnum { - // Not specified. - DESTINATION_ENUM_UNSPECIFIED = 0; - - // [Shopping ads](https://support.google.com/google-ads/answer/2454022). - SHOPPING_ADS = 1; - - // [Display ads](https://support.google.com/merchants/answer/6069387). - DISPLAY_ADS = 2; - - // [Local inventory - // ads](https://support.google.com/merchants/answer/3057972). - LOCAL_INVENTORY_ADS = 3; - - // [Free listings](https://support.google.com/merchants/answer/9199328). - FREE_LISTINGS = 4; - - // [Free local product - // listings](https://support.google.com/merchants/answer/9825611). - FREE_LOCAL_LISTINGS = 5; - - // [YouTube Shopping](https://support.google.com/merchants/answer/12362804). - YOUTUBE_SHOPPING = 6; - } -} - -// Reporting contexts that your account and product issues apply to. -// -// Reporting contexts are groups of surfaces and formats for product results on -// Google. They can represent the entire destination (for example, [Shopping -// ads](https://support.google.com/merchants/answer/6149970)) or a subset of -// formats within a destination (for example, [Demand Gen -// ads](https://support.google.com/merchants/answer/13389785)). -// -message ReportingContext { - // Reporting context values. - enum ReportingContextEnum { - // Not specified. - REPORTING_CONTEXT_ENUM_UNSPECIFIED = 0; - - // [Shopping ads](https://support.google.com/merchants/answer/6149970). - SHOPPING_ADS = 1; - - // Deprecated: Use `DEMAND_GEN_ADS` instead. - // [Discovery and Demand Gen - // ads](https://support.google.com/merchants/answer/13389785). - DISCOVERY_ADS = 2 [deprecated = true]; - - // [Demand Gen ads](https://support.google.com/merchants/answer/13389785). - DEMAND_GEN_ADS = 13; - - // [Demand Gen ads on Discover - // surface](https://support.google.com/merchants/answer/13389785). - DEMAND_GEN_ADS_DISCOVER_SURFACE = 14; - - // [Video ads](https://support.google.com/google-ads/answer/6340491). - VIDEO_ADS = 3; - - // [Display ads](https://support.google.com/merchants/answer/6069387). - DISPLAY_ADS = 4; - - // [Local inventory - // ads](https://support.google.com/merchants/answer/3271956). - LOCAL_INVENTORY_ADS = 5; - - // [Vehicle inventory - // ads](https://support.google.com/merchants/answer/11544533). - VEHICLE_INVENTORY_ADS = 6; - - // [Free product - // listings](https://support.google.com/merchants/answer/9199328). - FREE_LISTINGS = 7; - - // [Free local product - // listings](https://support.google.com/merchants/answer/9825611). - FREE_LOCAL_LISTINGS = 8; - - // [Free local vehicle - // listings](https://support.google.com/merchants/answer/11544533). - FREE_LOCAL_VEHICLE_LISTINGS = 9; - - // [YouTube - // Shopping](https://support.google.com/merchants/answer/13478370). - YOUTUBE_SHOPPING = 10; - - // [Cloud retail](https://cloud.google.com/solutions/retail). - CLOUD_RETAIL = 11; - - // [Local cloud retail](https://cloud.google.com/solutions/retail). - LOCAL_CLOUD_RETAIL = 12; - } -} - -// [Channel](https://support.google.com/merchants/answer/7361332) of a product. -// -// Channel is used to distinguish between online and local products. -message Channel { - // Channel values. - enum ChannelEnum { - // Not specified. - CHANNEL_ENUM_UNSPECIFIED = 0; - - // Online product. - ONLINE = 1; - - // Local product. - LOCAL = 2; - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.d.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.d.ts deleted file mode 100644 index e8ff635d1b8..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.d.ts +++ /dev/null @@ -1,22846 +0,0 @@ -// 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. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace shopping. */ - namespace shopping { - - /** Namespace merchant. */ - namespace merchant { - - /** Namespace accounts. */ - namespace accounts { - - /** Namespace v1beta. */ - namespace v1beta { - - /** AccessRight enum. */ - enum AccessRight { - ACCESS_RIGHT_UNSPECIFIED = 0, - STANDARD = 1, - ADMIN = 2, - PERFORMANCE_REPORTING = 3 - } - - /** Represents an AccountTaxService */ - class AccountTaxService extends $protobuf.rpc.Service { - - /** - * Constructs a new AccountTaxService 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 AccountTaxService 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): AccountTaxService; - - /** - * Calls GetAccountTax. - * @param request GetAccountTaxRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AccountTax - */ - public getAccountTax(request: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, callback: google.shopping.merchant.accounts.v1beta.AccountTaxService.GetAccountTaxCallback): void; - - /** - * Calls GetAccountTax. - * @param request GetAccountTaxRequest message or plain object - * @returns Promise - */ - public getAccountTax(request: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest): Promise; - - /** - * Calls ListAccountTax. - * @param request ListAccountTaxRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAccountTaxResponse - */ - public listAccountTax(request: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, callback: google.shopping.merchant.accounts.v1beta.AccountTaxService.ListAccountTaxCallback): void; - - /** - * Calls ListAccountTax. - * @param request ListAccountTaxRequest message or plain object - * @returns Promise - */ - public listAccountTax(request: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest): Promise; - - /** - * Calls UpdateAccountTax. - * @param request UpdateAccountTaxRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AccountTax - */ - public updateAccountTax(request: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, callback: google.shopping.merchant.accounts.v1beta.AccountTaxService.UpdateAccountTaxCallback): void; - - /** - * Calls UpdateAccountTax. - * @param request UpdateAccountTaxRequest message or plain object - * @returns Promise - */ - public updateAccountTax(request: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest): Promise; - } - - namespace AccountTaxService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|getAccountTax}. - * @param error Error, if any - * @param [response] AccountTax - */ - type GetAccountTaxCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.AccountTax) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|listAccountTax}. - * @param error Error, if any - * @param [response] ListAccountTaxResponse - */ - type ListAccountTaxCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|updateAccountTax}. - * @param error Error, if any - * @param [response] AccountTax - */ - type UpdateAccountTaxCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.AccountTax) => void; - } - - /** Properties of an AccountTax. */ - interface IAccountTax { - - /** AccountTax name */ - name?: (string|null); - - /** AccountTax account */ - account?: (number|Long|string|null); - - /** AccountTax taxRules */ - taxRules?: (google.shopping.merchant.accounts.v1beta.ITaxRule[]|null); - } - - /** Represents an AccountTax. */ - class AccountTax implements IAccountTax { - - /** - * Constructs a new AccountTax. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IAccountTax); - - /** AccountTax name. */ - public name: string; - - /** AccountTax account. */ - public account: (number|Long|string); - - /** AccountTax taxRules. */ - public taxRules: google.shopping.merchant.accounts.v1beta.ITaxRule[]; - - /** - * Creates a new AccountTax instance using the specified properties. - * @param [properties] Properties to set - * @returns AccountTax instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IAccountTax): google.shopping.merchant.accounts.v1beta.AccountTax; - - /** - * Encodes the specified AccountTax message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountTax.verify|verify} messages. - * @param message AccountTax message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IAccountTax, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AccountTax message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountTax.verify|verify} messages. - * @param message AccountTax message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAccountTax, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AccountTax message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AccountTax - * @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.AccountTax; - - /** - * Decodes an AccountTax message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AccountTax - * @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.AccountTax; - - /** - * Verifies an AccountTax 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 AccountTax message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AccountTax - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AccountTax; - - /** - * Creates a plain object from an AccountTax message. Also converts values to other types if specified. - * @param message AccountTax - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.AccountTax, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AccountTax to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AccountTax - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAccountTaxRequest. */ - interface IGetAccountTaxRequest { - - /** GetAccountTaxRequest name */ - name?: (string|null); - } - - /** Represents a GetAccountTaxRequest. */ - class GetAccountTaxRequest implements IGetAccountTaxRequest { - - /** - * Constructs a new GetAccountTaxRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest); - - /** GetAccountTaxRequest name. */ - public name: string; - - /** - * Creates a new GetAccountTaxRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAccountTaxRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest): google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest; - - /** - * Encodes the specified GetAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest.verify|verify} messages. - * @param message GetAccountTaxRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest.verify|verify} messages. - * @param message GetAccountTaxRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAccountTaxRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAccountTaxRequest - * @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.GetAccountTaxRequest; - - /** - * Decodes a GetAccountTaxRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAccountTaxRequest - * @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.GetAccountTaxRequest; - - /** - * Verifies a GetAccountTaxRequest 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 GetAccountTaxRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAccountTaxRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest; - - /** - * Creates a plain object from a GetAccountTaxRequest message. Also converts values to other types if specified. - * @param message GetAccountTaxRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAccountTaxRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAccountTaxRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateAccountTaxRequest. */ - interface IUpdateAccountTaxRequest { - - /** UpdateAccountTaxRequest accountTax */ - accountTax?: (google.shopping.merchant.accounts.v1beta.IAccountTax|null); - - /** UpdateAccountTaxRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateAccountTaxRequest. */ - class UpdateAccountTaxRequest implements IUpdateAccountTaxRequest { - - /** - * Constructs a new UpdateAccountTaxRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest); - - /** UpdateAccountTaxRequest accountTax. */ - public accountTax?: (google.shopping.merchant.accounts.v1beta.IAccountTax|null); - - /** UpdateAccountTaxRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateAccountTaxRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAccountTaxRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest): google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest; - - /** - * Encodes the specified UpdateAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.verify|verify} messages. - * @param message UpdateAccountTaxRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.verify|verify} messages. - * @param message UpdateAccountTaxRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateAccountTaxRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAccountTaxRequest - * @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.UpdateAccountTaxRequest; - - /** - * Decodes an UpdateAccountTaxRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAccountTaxRequest - * @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.UpdateAccountTaxRequest; - - /** - * Verifies an UpdateAccountTaxRequest 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 UpdateAccountTaxRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAccountTaxRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest; - - /** - * Creates a plain object from an UpdateAccountTaxRequest message. Also converts values to other types if specified. - * @param message UpdateAccountTaxRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateAccountTaxRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateAccountTaxRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAccountTaxRequest. */ - interface IListAccountTaxRequest { - - /** ListAccountTaxRequest parent */ - parent?: (string|null); - - /** ListAccountTaxRequest pageSize */ - pageSize?: (number|null); - - /** ListAccountTaxRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListAccountTaxRequest. */ - class ListAccountTaxRequest implements IListAccountTaxRequest { - - /** - * Constructs a new ListAccountTaxRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest); - - /** ListAccountTaxRequest parent. */ - public parent: string; - - /** ListAccountTaxRequest pageSize. */ - public pageSize: number; - - /** ListAccountTaxRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListAccountTaxRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAccountTaxRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest): google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest; - - /** - * Encodes the specified ListAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest.verify|verify} messages. - * @param message ListAccountTaxRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest.verify|verify} messages. - * @param message ListAccountTaxRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAccountTaxRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAccountTaxRequest - * @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.ListAccountTaxRequest; - - /** - * Decodes a ListAccountTaxRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAccountTaxRequest - * @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.ListAccountTaxRequest; - - /** - * Verifies a ListAccountTaxRequest 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 ListAccountTaxRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAccountTaxRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest; - - /** - * Creates a plain object from a ListAccountTaxRequest message. Also converts values to other types if specified. - * @param message ListAccountTaxRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAccountTaxRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAccountTaxRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAccountTaxResponse. */ - interface IListAccountTaxResponse { - - /** ListAccountTaxResponse accountTaxes */ - accountTaxes?: (google.shopping.merchant.accounts.v1beta.IAccountTax[]|null); - - /** ListAccountTaxResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAccountTaxResponse. */ - class ListAccountTaxResponse implements IListAccountTaxResponse { - - /** - * Constructs a new ListAccountTaxResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse); - - /** ListAccountTaxResponse accountTaxes. */ - public accountTaxes: google.shopping.merchant.accounts.v1beta.IAccountTax[]; - - /** ListAccountTaxResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAccountTaxResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAccountTaxResponse instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse): google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse; - - /** - * Encodes the specified ListAccountTaxResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.verify|verify} messages. - * @param message ListAccountTaxResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAccountTaxResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.verify|verify} messages. - * @param message ListAccountTaxResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAccountTaxResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAccountTaxResponse - * @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.ListAccountTaxResponse; - - /** - * Decodes a ListAccountTaxResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAccountTaxResponse - * @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.ListAccountTaxResponse; - - /** - * Verifies a ListAccountTaxResponse 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 ListAccountTaxResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAccountTaxResponse - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse; - - /** - * Creates a plain object from a ListAccountTaxResponse message. Also converts values to other types if specified. - * @param message ListAccountTaxResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAccountTaxResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAccountTaxResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TaxRule. */ - interface ITaxRule { - - /** TaxRule locationId */ - locationId?: (number|Long|string|null); - - /** TaxRule postCodeRange */ - postCodeRange?: (google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange|null); - - /** TaxRule useGoogleRate */ - useGoogleRate?: (boolean|null); - - /** TaxRule selfSpecifiedRateMicros */ - selfSpecifiedRateMicros?: (number|Long|string|null); - - /** TaxRule regionCode */ - regionCode?: (string|null); - - /** TaxRule shippingTaxed */ - shippingTaxed?: (boolean|null); - - /** TaxRule effectiveTimePeriod */ - effectiveTimePeriod?: (google.type.IInterval|null); - } - - /** Represents a TaxRule. */ - class TaxRule implements ITaxRule { - - /** - * Constructs a new TaxRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ITaxRule); - - /** TaxRule locationId. */ - public locationId?: (number|Long|string|null); - - /** TaxRule postCodeRange. */ - public postCodeRange?: (google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange|null); - - /** TaxRule useGoogleRate. */ - public useGoogleRate?: (boolean|null); - - /** TaxRule selfSpecifiedRateMicros. */ - public selfSpecifiedRateMicros?: (number|Long|string|null); - - /** TaxRule regionCode. */ - public regionCode: string; - - /** TaxRule shippingTaxed. */ - public shippingTaxed: boolean; - - /** TaxRule effectiveTimePeriod. */ - public effectiveTimePeriod?: (google.type.IInterval|null); - - /** TaxRule location. */ - public location?: ("locationId"|"postCodeRange"); - - /** TaxRule rateCalculation. */ - public rateCalculation?: ("useGoogleRate"|"selfSpecifiedRateMicros"); - - /** - * Creates a new TaxRule instance using the specified properties. - * @param [properties] Properties to set - * @returns TaxRule instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ITaxRule): google.shopping.merchant.accounts.v1beta.TaxRule; - - /** - * Encodes the specified TaxRule message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.verify|verify} messages. - * @param message TaxRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ITaxRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaxRule message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.verify|verify} messages. - * @param message TaxRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITaxRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaxRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaxRule - * @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.TaxRule; - - /** - * Decodes a TaxRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaxRule - * @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.TaxRule; - - /** - * Verifies a TaxRule 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 TaxRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaxRule - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TaxRule; - - /** - * Creates a plain object from a TaxRule message. Also converts values to other types if specified. - * @param message TaxRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.TaxRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaxRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaxRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TaxRule { - - /** Properties of a TaxPostalCodeRange. */ - interface ITaxPostalCodeRange { - - /** TaxPostalCodeRange start */ - start?: (string|null); - - /** TaxPostalCodeRange end */ - end?: (string|null); - } - - /** Represents a TaxPostalCodeRange. */ - class TaxPostalCodeRange implements ITaxPostalCodeRange { - - /** - * Constructs a new TaxPostalCodeRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange); - - /** TaxPostalCodeRange start. */ - public start: string; - - /** TaxPostalCodeRange end. */ - public end: string; - - /** - * Creates a new TaxPostalCodeRange instance using the specified properties. - * @param [properties] Properties to set - * @returns TaxPostalCodeRange instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange): google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange; - - /** - * Encodes the specified TaxPostalCodeRange message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify|verify} messages. - * @param message TaxPostalCodeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaxPostalCodeRange message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify|verify} messages. - * @param message TaxPostalCodeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaxPostalCodeRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaxPostalCodeRange - * @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.TaxRule.TaxPostalCodeRange; - - /** - * Decodes a TaxPostalCodeRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaxPostalCodeRange - * @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.TaxRule.TaxPostalCodeRange; - - /** - * Verifies a TaxPostalCodeRange 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 TaxPostalCodeRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaxPostalCodeRange - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange; - - /** - * Creates a plain object from a TaxPostalCodeRange message. Also converts values to other types if specified. - * @param message TaxPostalCodeRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaxPostalCodeRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaxPostalCodeRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Represents an AccountIssueService */ - class AccountIssueService extends $protobuf.rpc.Service { - - /** - * Constructs a new AccountIssueService 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 AccountIssueService 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): AccountIssueService; - - /** - * Calls ListAccountIssues. - * @param request ListAccountIssuesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAccountIssuesResponse - */ - public listAccountIssues(request: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, callback: google.shopping.merchant.accounts.v1beta.AccountIssueService.ListAccountIssuesCallback): void; - - /** - * Calls ListAccountIssues. - * @param request ListAccountIssuesRequest message or plain object - * @returns Promise - */ - public listAccountIssues(request: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest): Promise; - } - - namespace AccountIssueService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountIssueService|listAccountIssues}. - * @param error Error, if any - * @param [response] ListAccountIssuesResponse - */ - type ListAccountIssuesCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse) => void; - } - - /** Properties of an AccountIssue. */ - interface IAccountIssue { - - /** AccountIssue name */ - name?: (string|null); - - /** AccountIssue title */ - title?: (string|null); - - /** AccountIssue severity */ - severity?: (google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|keyof typeof google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|null); - - /** AccountIssue impactedDestinations */ - impactedDestinations?: (google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination[]|null); - - /** AccountIssue detail */ - detail?: (string|null); - - /** AccountIssue documentationUri */ - documentationUri?: (string|null); - } - - /** Represents an AccountIssue. */ - class AccountIssue implements IAccountIssue { - - /** - * Constructs a new AccountIssue. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IAccountIssue); - - /** AccountIssue name. */ - public name: string; - - /** AccountIssue title. */ - public title: string; - - /** AccountIssue severity. */ - public severity: (google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|keyof typeof google.shopping.merchant.accounts.v1beta.AccountIssue.Severity); - - /** AccountIssue impactedDestinations. */ - public impactedDestinations: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination[]; - - /** AccountIssue detail. */ - public detail: string; - - /** AccountIssue documentationUri. */ - public documentationUri: string; - - /** - * Creates a new AccountIssue instance using the specified properties. - * @param [properties] Properties to set - * @returns AccountIssue instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IAccountIssue): google.shopping.merchant.accounts.v1beta.AccountIssue; - - /** - * Encodes the specified AccountIssue message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.verify|verify} messages. - * @param message AccountIssue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IAccountIssue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AccountIssue message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.verify|verify} messages. - * @param message AccountIssue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAccountIssue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AccountIssue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AccountIssue - * @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.AccountIssue; - - /** - * Decodes an AccountIssue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AccountIssue - * @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.AccountIssue; - - /** - * Verifies an AccountIssue 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 AccountIssue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AccountIssue - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AccountIssue; - - /** - * Creates a plain object from an AccountIssue message. Also converts values to other types if specified. - * @param message AccountIssue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.AccountIssue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AccountIssue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AccountIssue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AccountIssue { - - /** Properties of an ImpactedDestination. */ - interface IImpactedDestination { - - /** ImpactedDestination reportingContext */ - reportingContext?: (google.shopping.type.ReportingContext.ReportingContextEnum|keyof typeof google.shopping.type.ReportingContext.ReportingContextEnum|null); - - /** ImpactedDestination impacts */ - impacts?: (google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact[]|null); - } - - /** Represents an ImpactedDestination. */ - class ImpactedDestination implements IImpactedDestination { - - /** - * Constructs a new ImpactedDestination. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination); - - /** ImpactedDestination reportingContext. */ - public reportingContext?: (google.shopping.type.ReportingContext.ReportingContextEnum|keyof typeof google.shopping.type.ReportingContext.ReportingContextEnum|null); - - /** ImpactedDestination impacts. */ - public impacts: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact[]; - - /** ImpactedDestination _reportingContext. */ - public _reportingContext?: "reportingContext"; - - /** - * Creates a new ImpactedDestination instance using the specified properties. - * @param [properties] Properties to set - * @returns ImpactedDestination instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination): google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination; - - /** - * Encodes the specified ImpactedDestination message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify|verify} messages. - * @param message ImpactedDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImpactedDestination message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify|verify} messages. - * @param message ImpactedDestination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImpactedDestination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImpactedDestination - * @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.AccountIssue.ImpactedDestination; - - /** - * Decodes an ImpactedDestination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImpactedDestination - * @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.AccountIssue.ImpactedDestination; - - /** - * Verifies an ImpactedDestination 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 ImpactedDestination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImpactedDestination - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination; - - /** - * Creates a plain object from an ImpactedDestination message. Also converts values to other types if specified. - * @param message ImpactedDestination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImpactedDestination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImpactedDestination - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImpactedDestination { - - /** Properties of an Impact. */ - interface IImpact { - - /** Impact regionCode */ - regionCode?: (string|null); - - /** Impact severity */ - severity?: (google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|keyof typeof google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|null); - } - - /** Represents an Impact. */ - class Impact implements IImpact { - - /** - * Constructs a new Impact. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact); - - /** Impact regionCode. */ - public regionCode: string; - - /** Impact severity. */ - public severity: (google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|keyof typeof google.shopping.merchant.accounts.v1beta.AccountIssue.Severity); - - /** - * Creates a new Impact instance using the specified properties. - * @param [properties] Properties to set - * @returns Impact instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact): google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact; - - /** - * Encodes the specified Impact message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify|verify} messages. - * @param message Impact message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Impact message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify|verify} messages. - * @param message Impact message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Impact message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Impact - * @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.AccountIssue.ImpactedDestination.Impact; - - /** - * Decodes an Impact message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Impact - * @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.AccountIssue.ImpactedDestination.Impact; - - /** - * Verifies an Impact 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 Impact message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Impact - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact; - - /** - * Creates a plain object from an Impact message. Also converts values to other types if specified. - * @param message Impact - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Impact to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Impact - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Severity enum. */ - enum Severity { - SEVERITY_UNSPECIFIED = 0, - CRITICAL = 1, - ERROR = 2, - SUGGESTION = 3 - } - } - - /** Properties of a ListAccountIssuesRequest. */ - interface IListAccountIssuesRequest { - - /** ListAccountIssuesRequest parent */ - parent?: (string|null); - - /** ListAccountIssuesRequest pageSize */ - pageSize?: (number|null); - - /** ListAccountIssuesRequest pageToken */ - pageToken?: (string|null); - - /** ListAccountIssuesRequest languageCode */ - languageCode?: (string|null); - - /** ListAccountIssuesRequest timeZone */ - timeZone?: (string|null); - } - - /** Represents a ListAccountIssuesRequest. */ - class ListAccountIssuesRequest implements IListAccountIssuesRequest { - - /** - * Constructs a new ListAccountIssuesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest); - - /** ListAccountIssuesRequest parent. */ - public parent: string; - - /** ListAccountIssuesRequest pageSize. */ - public pageSize: number; - - /** ListAccountIssuesRequest pageToken. */ - public pageToken: string; - - /** ListAccountIssuesRequest languageCode. */ - public languageCode: string; - - /** ListAccountIssuesRequest timeZone. */ - public timeZone: string; - - /** - * Creates a new ListAccountIssuesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAccountIssuesRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest): google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest; - - /** - * Encodes the specified ListAccountIssuesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest.verify|verify} messages. - * @param message ListAccountIssuesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAccountIssuesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest.verify|verify} messages. - * @param message ListAccountIssuesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAccountIssuesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAccountIssuesRequest - * @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.ListAccountIssuesRequest; - - /** - * Decodes a ListAccountIssuesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAccountIssuesRequest - * @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.ListAccountIssuesRequest; - - /** - * Verifies a ListAccountIssuesRequest 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 ListAccountIssuesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAccountIssuesRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest; - - /** - * Creates a plain object from a ListAccountIssuesRequest message. Also converts values to other types if specified. - * @param message ListAccountIssuesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAccountIssuesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAccountIssuesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAccountIssuesResponse. */ - interface IListAccountIssuesResponse { - - /** ListAccountIssuesResponse accountIssues */ - accountIssues?: (google.shopping.merchant.accounts.v1beta.IAccountIssue[]|null); - - /** ListAccountIssuesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAccountIssuesResponse. */ - class ListAccountIssuesResponse implements IListAccountIssuesResponse { - - /** - * Constructs a new ListAccountIssuesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse); - - /** ListAccountIssuesResponse accountIssues. */ - public accountIssues: google.shopping.merchant.accounts.v1beta.IAccountIssue[]; - - /** ListAccountIssuesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAccountIssuesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAccountIssuesResponse instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse): google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse; - - /** - * Encodes the specified ListAccountIssuesResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.verify|verify} messages. - * @param message ListAccountIssuesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAccountIssuesResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.verify|verify} messages. - * @param message ListAccountIssuesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAccountIssuesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAccountIssuesResponse - * @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.ListAccountIssuesResponse; - - /** - * Decodes a ListAccountIssuesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAccountIssuesResponse - * @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.ListAccountIssuesResponse; - - /** - * Verifies a ListAccountIssuesResponse 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 ListAccountIssuesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAccountIssuesResponse - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse; - - /** - * Creates a plain object from a ListAccountIssuesResponse message. Also converts values to other types if specified. - * @param message ListAccountIssuesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAccountIssuesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAccountIssuesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an AccountsService */ - class AccountsService extends $protobuf.rpc.Service { - - /** - * Constructs a new AccountsService 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 AccountsService 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): AccountsService; - - /** - * Calls GetAccount. - * @param request GetAccountRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Account - */ - public getAccount(request: google.shopping.merchant.accounts.v1beta.IGetAccountRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.GetAccountCallback): void; - - /** - * Calls GetAccount. - * @param request GetAccountRequest message or plain object - * @returns Promise - */ - public getAccount(request: google.shopping.merchant.accounts.v1beta.IGetAccountRequest): Promise; - - /** - * Calls CreateAndConfigureAccount. - * @param request CreateAndConfigureAccountRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Account - */ - public createAndConfigureAccount(request: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.CreateAndConfigureAccountCallback): void; - - /** - * Calls CreateAndConfigureAccount. - * @param request CreateAndConfigureAccountRequest message or plain object - * @returns Promise - */ - public createAndConfigureAccount(request: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest): Promise; - - /** - * Calls DeleteAccount. - * @param request DeleteAccountRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteAccount(request: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.DeleteAccountCallback): void; - - /** - * Calls DeleteAccount. - * @param request DeleteAccountRequest message or plain object - * @returns Promise - */ - public deleteAccount(request: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest): Promise; - - /** - * Calls UpdateAccount. - * @param request UpdateAccountRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Account - */ - public updateAccount(request: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.UpdateAccountCallback): void; - - /** - * Calls UpdateAccount. - * @param request UpdateAccountRequest message or plain object - * @returns Promise - */ - public updateAccount(request: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest): Promise; - - /** - * Calls ListAccounts. - * @param request ListAccountsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAccountsResponse - */ - public listAccounts(request: google.shopping.merchant.accounts.v1beta.IListAccountsRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.ListAccountsCallback): void; - - /** - * Calls ListAccounts. - * @param request ListAccountsRequest message or plain object - * @returns Promise - */ - public listAccounts(request: google.shopping.merchant.accounts.v1beta.IListAccountsRequest): Promise; - - /** - * Calls ListSubAccounts. - * @param request ListSubAccountsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSubAccountsResponse - */ - public listSubAccounts(request: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, callback: google.shopping.merchant.accounts.v1beta.AccountsService.ListSubAccountsCallback): void; - - /** - * Calls ListSubAccounts. - * @param request ListSubAccountsRequest message or plain object - * @returns Promise - */ - public listSubAccounts(request: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest): Promise; - } - - namespace AccountsService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|getAccount}. - * @param error Error, if any - * @param [response] Account - */ - type GetAccountCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Account) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|createAndConfigureAccount}. - * @param error Error, if any - * @param [response] Account - */ - type CreateAndConfigureAccountCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Account) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|deleteAccount}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteAccountCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|updateAccount}. - * @param error Error, if any - * @param [response] Account - */ - type UpdateAccountCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Account) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|listAccounts}. - * @param error Error, if any - * @param [response] ListAccountsResponse - */ - type ListAccountsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListAccountsResponse) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|listSubAccounts}. - * @param error Error, if any - * @param [response] ListSubAccountsResponse - */ - type ListSubAccountsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse) => void; - } - - /** Properties of an Account. */ - interface IAccount { - - /** Account name */ - name?: (string|null); - - /** Account accountId */ - accountId?: (number|Long|string|null); - - /** Account accountName */ - accountName?: (string|null); - - /** Account adultContent */ - adultContent?: (boolean|null); - - /** Account testAccount */ - testAccount?: (boolean|null); - - /** Account timeZone */ - timeZone?: (google.type.ITimeZone|null); - - /** Account languageCode */ - languageCode?: (string|null); - } - - /** Represents an Account. */ - class Account implements IAccount { - - /** - * Constructs a new Account. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IAccount); - - /** Account name. */ - public name: string; - - /** Account accountId. */ - public accountId: (number|Long|string); - - /** Account accountName. */ - public accountName: string; - - /** Account adultContent. */ - public adultContent: boolean; - - /** Account testAccount. */ - public testAccount: boolean; - - /** Account timeZone. */ - public timeZone?: (google.type.ITimeZone|null); - - /** Account languageCode. */ - public languageCode: string; - - /** - * Creates a new Account instance using the specified properties. - * @param [properties] Properties to set - * @returns Account instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IAccount): google.shopping.merchant.accounts.v1beta.Account; - - /** - * Encodes the specified Account message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Account.verify|verify} messages. - * @param message Account message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Account message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Account.verify|verify} messages. - * @param message Account message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Account message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Account - * @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.Account; - - /** - * Decodes an Account message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Account - * @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.Account; - - /** - * Verifies an Account 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 Account message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Account - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Account; - - /** - * Creates a plain object from an Account message. Also converts values to other types if specified. - * @param message Account - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Account, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Account to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Account - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAccountRequest. */ - interface IGetAccountRequest { - - /** GetAccountRequest name */ - name?: (string|null); - } - - /** Represents a GetAccountRequest. */ - class GetAccountRequest implements IGetAccountRequest { - - /** - * Constructs a new GetAccountRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetAccountRequest); - - /** GetAccountRequest name. */ - public name: string; - - /** - * Creates a new GetAccountRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAccountRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetAccountRequest): google.shopping.merchant.accounts.v1beta.GetAccountRequest; - - /** - * Encodes the specified GetAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountRequest.verify|verify} messages. - * @param message GetAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountRequest.verify|verify} messages. - * @param message GetAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAccountRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAccountRequest - * @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.GetAccountRequest; - - /** - * Decodes a GetAccountRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAccountRequest - * @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.GetAccountRequest; - - /** - * Verifies a GetAccountRequest 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 GetAccountRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAccountRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetAccountRequest; - - /** - * Creates a plain object from a GetAccountRequest message. Also converts values to other types if specified. - * @param message GetAccountRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAccountRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAccountRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateAndConfigureAccountRequest. */ - interface ICreateAndConfigureAccountRequest { - - /** CreateAndConfigureAccountRequest account */ - account?: (google.shopping.merchant.accounts.v1beta.IAccount|null); - - /** CreateAndConfigureAccountRequest users */ - users?: (google.shopping.merchant.accounts.v1beta.ICreateUserRequest[]|null); - - /** CreateAndConfigureAccountRequest acceptTermsOfService */ - acceptTermsOfService?: (google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService|null); - - /** CreateAndConfigureAccountRequest service */ - service?: (google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService[]|null); - } - - /** Represents a CreateAndConfigureAccountRequest. */ - class CreateAndConfigureAccountRequest implements ICreateAndConfigureAccountRequest { - - /** - * Constructs a new CreateAndConfigureAccountRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest); - - /** CreateAndConfigureAccountRequest account. */ - public account?: (google.shopping.merchant.accounts.v1beta.IAccount|null); - - /** CreateAndConfigureAccountRequest users. */ - public users: google.shopping.merchant.accounts.v1beta.ICreateUserRequest[]; - - /** CreateAndConfigureAccountRequest acceptTermsOfService. */ - public acceptTermsOfService?: (google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService|null); - - /** CreateAndConfigureAccountRequest service. */ - public service: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService[]; - - /** CreateAndConfigureAccountRequest _acceptTermsOfService. */ - public _acceptTermsOfService?: "acceptTermsOfService"; - - /** - * Creates a new CreateAndConfigureAccountRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAndConfigureAccountRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest; - - /** - * Encodes the specified CreateAndConfigureAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.verify|verify} messages. - * @param message CreateAndConfigureAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAndConfigureAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.verify|verify} messages. - * @param message CreateAndConfigureAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAndConfigureAccountRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAndConfigureAccountRequest - * @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.CreateAndConfigureAccountRequest; - - /** - * Decodes a CreateAndConfigureAccountRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAndConfigureAccountRequest - * @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.CreateAndConfigureAccountRequest; - - /** - * Verifies a CreateAndConfigureAccountRequest 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 CreateAndConfigureAccountRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAndConfigureAccountRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest; - - /** - * Creates a plain object from a CreateAndConfigureAccountRequest message. Also converts values to other types if specified. - * @param message CreateAndConfigureAccountRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAndConfigureAccountRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateAndConfigureAccountRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CreateAndConfigureAccountRequest { - - /** Properties of an AcceptTermsOfService. */ - interface IAcceptTermsOfService { - - /** AcceptTermsOfService name */ - name?: (string|null); - - /** AcceptTermsOfService regionCode */ - regionCode?: (string|null); - } - - /** Represents an AcceptTermsOfService. */ - class AcceptTermsOfService implements IAcceptTermsOfService { - - /** - * Constructs a new AcceptTermsOfService. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService); - - /** AcceptTermsOfService name. */ - public name: string; - - /** AcceptTermsOfService regionCode. */ - public regionCode: string; - - /** - * Creates a new AcceptTermsOfService instance using the specified properties. - * @param [properties] Properties to set - * @returns AcceptTermsOfService instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService; - - /** - * Encodes the specified AcceptTermsOfService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify|verify} messages. - * @param message AcceptTermsOfService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AcceptTermsOfService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify|verify} messages. - * @param message AcceptTermsOfService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AcceptTermsOfService message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AcceptTermsOfService - * @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.CreateAndConfigureAccountRequest.AcceptTermsOfService; - - /** - * Decodes an AcceptTermsOfService message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AcceptTermsOfService - * @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.CreateAndConfigureAccountRequest.AcceptTermsOfService; - - /** - * Verifies an AcceptTermsOfService 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 AcceptTermsOfService message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AcceptTermsOfService - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService; - - /** - * Creates a plain object from an AcceptTermsOfService message. Also converts values to other types if specified. - * @param message AcceptTermsOfService - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AcceptTermsOfService to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AcceptTermsOfService - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AddAccountService. */ - interface IAddAccountService { - - /** AddAccountService accountAggregation */ - accountAggregation?: (google.shopping.merchant.accounts.v1beta.IAccountAggregation|null); - - /** AddAccountService provider */ - provider?: (string|null); - } - - /** Represents an AddAccountService. */ - class AddAccountService implements IAddAccountService { - - /** - * Constructs a new AddAccountService. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService); - - /** AddAccountService accountAggregation. */ - public accountAggregation?: (google.shopping.merchant.accounts.v1beta.IAccountAggregation|null); - - /** AddAccountService provider. */ - public provider?: (string|null); - - /** AddAccountService serviceType. */ - public serviceType?: "accountAggregation"; - - /** AddAccountService _provider. */ - public _provider?: "provider"; - - /** - * Creates a new AddAccountService instance using the specified properties. - * @param [properties] Properties to set - * @returns AddAccountService instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService; - - /** - * Encodes the specified AddAccountService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify|verify} messages. - * @param message AddAccountService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AddAccountService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify|verify} messages. - * @param message AddAccountService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AddAccountService message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AddAccountService - * @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.CreateAndConfigureAccountRequest.AddAccountService; - - /** - * Decodes an AddAccountService message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AddAccountService - * @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.CreateAndConfigureAccountRequest.AddAccountService; - - /** - * Verifies an AddAccountService 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 AddAccountService message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AddAccountService - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService; - - /** - * Creates a plain object from an AddAccountService message. Also converts values to other types if specified. - * @param message AddAccountService - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AddAccountService to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AddAccountService - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a DeleteAccountRequest. */ - interface IDeleteAccountRequest { - - /** DeleteAccountRequest name */ - name?: (string|null); - } - - /** Represents a DeleteAccountRequest. */ - class DeleteAccountRequest implements IDeleteAccountRequest { - - /** - * Constructs a new DeleteAccountRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest); - - /** DeleteAccountRequest name. */ - public name: string; - - /** - * Creates a new DeleteAccountRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAccountRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest): google.shopping.merchant.accounts.v1beta.DeleteAccountRequest; - - /** - * Encodes the specified DeleteAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteAccountRequest.verify|verify} messages. - * @param message DeleteAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteAccountRequest.verify|verify} messages. - * @param message DeleteAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAccountRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAccountRequest - * @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.DeleteAccountRequest; - - /** - * Decodes a DeleteAccountRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAccountRequest - * @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.DeleteAccountRequest; - - /** - * Verifies a DeleteAccountRequest 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 DeleteAccountRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAccountRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DeleteAccountRequest; - - /** - * Creates a plain object from a DeleteAccountRequest message. Also converts values to other types if specified. - * @param message DeleteAccountRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.DeleteAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAccountRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteAccountRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateAccountRequest. */ - interface IUpdateAccountRequest { - - /** UpdateAccountRequest account */ - account?: (google.shopping.merchant.accounts.v1beta.IAccount|null); - - /** UpdateAccountRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateAccountRequest. */ - class UpdateAccountRequest implements IUpdateAccountRequest { - - /** - * Constructs a new UpdateAccountRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest); - - /** UpdateAccountRequest account. */ - public account?: (google.shopping.merchant.accounts.v1beta.IAccount|null); - - /** UpdateAccountRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateAccountRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAccountRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest): google.shopping.merchant.accounts.v1beta.UpdateAccountRequest; - - /** - * Encodes the specified UpdateAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.verify|verify} messages. - * @param message UpdateAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.verify|verify} messages. - * @param message UpdateAccountRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateAccountRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAccountRequest - * @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.UpdateAccountRequest; - - /** - * Decodes an UpdateAccountRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAccountRequest - * @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.UpdateAccountRequest; - - /** - * Verifies an UpdateAccountRequest 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 UpdateAccountRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAccountRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateAccountRequest; - - /** - * Creates a plain object from an UpdateAccountRequest message. Also converts values to other types if specified. - * @param message UpdateAccountRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateAccountRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateAccountRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAccountsRequest. */ - interface IListAccountsRequest { - - /** ListAccountsRequest pageSize */ - pageSize?: (number|null); - - /** ListAccountsRequest pageToken */ - pageToken?: (string|null); - - /** ListAccountsRequest filter */ - filter?: (string|null); - } - - /** Represents a ListAccountsRequest. */ - class ListAccountsRequest implements IListAccountsRequest { - - /** - * Constructs a new ListAccountsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountsRequest); - - /** ListAccountsRequest pageSize. */ - public pageSize: number; - - /** ListAccountsRequest pageToken. */ - public pageToken: string; - - /** ListAccountsRequest filter. */ - public filter: string; - - /** - * Creates a new ListAccountsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAccountsRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountsRequest): google.shopping.merchant.accounts.v1beta.ListAccountsRequest; - - /** - * Encodes the specified ListAccountsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsRequest.verify|verify} messages. - * @param message ListAccountsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAccountsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsRequest.verify|verify} messages. - * @param message ListAccountsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAccountsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAccountsRequest - * @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.ListAccountsRequest; - - /** - * Decodes a ListAccountsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAccountsRequest - * @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.ListAccountsRequest; - - /** - * Verifies a ListAccountsRequest 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 ListAccountsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAccountsRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountsRequest; - - /** - * Creates a plain object from a ListAccountsRequest message. Also converts values to other types if specified. - * @param message ListAccountsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAccountsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAccountsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAccountsResponse. */ - interface IListAccountsResponse { - - /** ListAccountsResponse accounts */ - accounts?: (google.shopping.merchant.accounts.v1beta.IAccount[]|null); - - /** ListAccountsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAccountsResponse. */ - class ListAccountsResponse implements IListAccountsResponse { - - /** - * Constructs a new ListAccountsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListAccountsResponse); - - /** ListAccountsResponse accounts. */ - public accounts: google.shopping.merchant.accounts.v1beta.IAccount[]; - - /** ListAccountsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAccountsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAccountsResponse instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListAccountsResponse): google.shopping.merchant.accounts.v1beta.ListAccountsResponse; - - /** - * Encodes the specified ListAccountsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsResponse.verify|verify} messages. - * @param message ListAccountsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAccountsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsResponse.verify|verify} messages. - * @param message ListAccountsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAccountsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAccountsResponse - * @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.ListAccountsResponse; - - /** - * Decodes a ListAccountsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAccountsResponse - * @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.ListAccountsResponse; - - /** - * Verifies a ListAccountsResponse 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 ListAccountsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAccountsResponse - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListAccountsResponse; - - /** - * Creates a plain object from a ListAccountsResponse message. Also converts values to other types if specified. - * @param message ListAccountsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListAccountsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAccountsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAccountsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSubAccountsRequest. */ - interface IListSubAccountsRequest { - - /** ListSubAccountsRequest provider */ - provider?: (string|null); - - /** ListSubAccountsRequest pageSize */ - pageSize?: (number|null); - - /** ListSubAccountsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListSubAccountsRequest. */ - class ListSubAccountsRequest implements IListSubAccountsRequest { - - /** - * Constructs a new ListSubAccountsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest); - - /** ListSubAccountsRequest provider. */ - public provider: string; - - /** ListSubAccountsRequest pageSize. */ - public pageSize: number; - - /** ListSubAccountsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListSubAccountsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSubAccountsRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest): google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest; - - /** - * Encodes the specified ListSubAccountsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest.verify|verify} messages. - * @param message ListSubAccountsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSubAccountsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest.verify|verify} messages. - * @param message ListSubAccountsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSubAccountsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSubAccountsRequest - * @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.ListSubAccountsRequest; - - /** - * Decodes a ListSubAccountsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSubAccountsRequest - * @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.ListSubAccountsRequest; - - /** - * Verifies a ListSubAccountsRequest 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 ListSubAccountsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSubAccountsRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest; - - /** - * Creates a plain object from a ListSubAccountsRequest message. Also converts values to other types if specified. - * @param message ListSubAccountsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSubAccountsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSubAccountsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSubAccountsResponse. */ - interface IListSubAccountsResponse { - - /** ListSubAccountsResponse accounts */ - accounts?: (google.shopping.merchant.accounts.v1beta.IAccount[]|null); - - /** ListSubAccountsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSubAccountsResponse. */ - class ListSubAccountsResponse implements IListSubAccountsResponse { - - /** - * Constructs a new ListSubAccountsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse); - - /** ListSubAccountsResponse accounts. */ - public accounts: google.shopping.merchant.accounts.v1beta.IAccount[]; - - /** ListSubAccountsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSubAccountsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSubAccountsResponse instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse): google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse; - - /** - * Encodes the specified ListSubAccountsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.verify|verify} messages. - * @param message ListSubAccountsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSubAccountsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.verify|verify} messages. - * @param message ListSubAccountsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSubAccountsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSubAccountsResponse - * @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.ListSubAccountsResponse; - - /** - * Decodes a ListSubAccountsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSubAccountsResponse - * @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.ListSubAccountsResponse; - - /** - * Verifies a ListSubAccountsResponse 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 ListSubAccountsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSubAccountsResponse - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse; - - /** - * Creates a plain object from a ListSubAccountsResponse message. Also converts values to other types if specified. - * @param message ListSubAccountsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSubAccountsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSubAccountsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - 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 { - - /** - * Constructs a new UserService 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 UserService 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): UserService; - - /** - * Calls GetUser. - * @param request GetUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public getUser(request: google.shopping.merchant.accounts.v1beta.IGetUserRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.GetUserCallback): void; - - /** - * Calls GetUser. - * @param request GetUserRequest message or plain object - * @returns Promise - */ - public getUser(request: google.shopping.merchant.accounts.v1beta.IGetUserRequest): Promise; - - /** - * Calls CreateUser. - * @param request CreateUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public createUser(request: google.shopping.merchant.accounts.v1beta.ICreateUserRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.CreateUserCallback): void; - - /** - * Calls CreateUser. - * @param request CreateUserRequest message or plain object - * @returns Promise - */ - public createUser(request: google.shopping.merchant.accounts.v1beta.ICreateUserRequest): Promise; - - /** - * Calls DeleteUser. - * @param request DeleteUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteUser(request: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.DeleteUserCallback): void; - - /** - * Calls DeleteUser. - * @param request DeleteUserRequest message or plain object - * @returns Promise - */ - public deleteUser(request: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest): Promise; - - /** - * Calls UpdateUser. - * @param request UpdateUserRequest message or plain object - * @param callback Node-style callback called with the error, if any, and User - */ - public updateUser(request: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.UpdateUserCallback): void; - - /** - * Calls UpdateUser. - * @param request UpdateUserRequest message or plain object - * @returns Promise - */ - public updateUser(request: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest): Promise; - - /** - * Calls ListUsers. - * @param request ListUsersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListUsersResponse - */ - public listUsers(request: google.shopping.merchant.accounts.v1beta.IListUsersRequest, callback: google.shopping.merchant.accounts.v1beta.UserService.ListUsersCallback): void; - - /** - * Calls ListUsers. - * @param request ListUsersRequest message or plain object - * @returns Promise - */ - public listUsers(request: google.shopping.merchant.accounts.v1beta.IListUsersRequest): Promise; - } - - namespace UserService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|getUser}. - * @param error Error, if any - * @param [response] User - */ - type GetUserCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.User) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|createUser}. - * @param error Error, if any - * @param [response] User - */ - type CreateUserCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.User) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|deleteUser}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteUserCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|updateUser}. - * @param error Error, if any - * @param [response] User - */ - type UpdateUserCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.User) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|listUsers}. - * @param error Error, if any - * @param [response] ListUsersResponse - */ - type ListUsersCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListUsersResponse) => void; - } - - /** Properties of a User. */ - interface IUser { - - /** User name */ - name?: (string|null); - - /** User state */ - state?: (google.shopping.merchant.accounts.v1beta.User.State|keyof typeof google.shopping.merchant.accounts.v1beta.User.State|null); - - /** User accessRights */ - accessRights?: (google.shopping.merchant.accounts.v1beta.AccessRight[]|null); - } - - /** Represents a User. */ - class User implements IUser { - - /** - * Constructs a new User. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUser); - - /** User name. */ - public name: string; - - /** User state. */ - public state: (google.shopping.merchant.accounts.v1beta.User.State|keyof typeof google.shopping.merchant.accounts.v1beta.User.State); - - /** User accessRights. */ - public accessRights: google.shopping.merchant.accounts.v1beta.AccessRight[]; - - /** - * Creates a new User instance using the specified properties. - * @param [properties] Properties to set - * @returns User instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUser): google.shopping.merchant.accounts.v1beta.User; - - /** - * Encodes the specified User message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.User.verify|verify} messages. - * @param message User message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.User.verify|verify} messages. - * @param message User message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUser, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a User message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns User - * @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.User; - - /** - * Decodes a User message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns User - * @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.User; - - /** - * Verifies a User 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 User message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns User - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.User; - - /** - * Creates a plain object from a User message. Also converts values to other types if specified. - * @param message User - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this User to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for User - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace User { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - VERIFIED = 2 - } - } - - /** Properties of a GetUserRequest. */ - interface IGetUserRequest { - - /** GetUserRequest name */ - name?: (string|null); - } - - /** Represents a GetUserRequest. */ - class GetUserRequest implements IGetUserRequest { - - /** - * Constructs a new GetUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetUserRequest); - - /** GetUserRequest name. */ - public name: string; - - /** - * Creates a new GetUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetUserRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetUserRequest): google.shopping.merchant.accounts.v1beta.GetUserRequest; - - /** - * Encodes the specified GetUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetUserRequest.verify|verify} messages. - * @param message GetUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetUserRequest.verify|verify} messages. - * @param message GetUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetUserRequest - * @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.GetUserRequest; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetUserRequest - * @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.GetUserRequest; - - /** - * Verifies a GetUserRequest 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 GetUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetUserRequest; - - /** - * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. - * @param message GetUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateUserRequest. */ - interface ICreateUserRequest { - - /** CreateUserRequest parent */ - parent?: (string|null); - - /** CreateUserRequest userId */ - userId?: (string|null); - - /** CreateUserRequest user */ - user?: (google.shopping.merchant.accounts.v1beta.IUser|null); - } - - /** Represents a CreateUserRequest. */ - class CreateUserRequest implements ICreateUserRequest { - - /** - * Constructs a new CreateUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ICreateUserRequest); - - /** CreateUserRequest parent. */ - public parent: string; - - /** CreateUserRequest userId. */ - public userId: string; - - /** CreateUserRequest user. */ - public user?: (google.shopping.merchant.accounts.v1beta.IUser|null); - - /** - * Creates a new CreateUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateUserRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ICreateUserRequest): google.shopping.merchant.accounts.v1beta.CreateUserRequest; - - /** - * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify|verify} messages. - * @param message CreateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify|verify} messages. - * @param message CreateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICreateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateUserRequest - * @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.CreateUserRequest; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateUserRequest - * @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.CreateUserRequest; - - /** - * Verifies a CreateUserRequest 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 CreateUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateUserRequest; - - /** - * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. - * @param message CreateUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteUserRequest. */ - interface IDeleteUserRequest { - - /** DeleteUserRequest name */ - name?: (string|null); - } - - /** Represents a DeleteUserRequest. */ - class DeleteUserRequest implements IDeleteUserRequest { - - /** - * Constructs a new DeleteUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest); - - /** DeleteUserRequest name. */ - public name: string; - - /** - * Creates a new DeleteUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteUserRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest): google.shopping.merchant.accounts.v1beta.DeleteUserRequest; - - /** - * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteUserRequest.verify|verify} messages. - * @param message DeleteUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteUserRequest.verify|verify} messages. - * @param message DeleteUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteUserRequest - * @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.DeleteUserRequest; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteUserRequest - * @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.DeleteUserRequest; - - /** - * Verifies a DeleteUserRequest 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 DeleteUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DeleteUserRequest; - - /** - * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. - * @param message DeleteUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.DeleteUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateUserRequest. */ - interface IUpdateUserRequest { - - /** UpdateUserRequest user */ - user?: (google.shopping.merchant.accounts.v1beta.IUser|null); - - /** UpdateUserRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateUserRequest. */ - class UpdateUserRequest implements IUpdateUserRequest { - - /** - * Constructs a new UpdateUserRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest); - - /** UpdateUserRequest user. */ - public user?: (google.shopping.merchant.accounts.v1beta.IUser|null); - - /** UpdateUserRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateUserRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateUserRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest): google.shopping.merchant.accounts.v1beta.UpdateUserRequest; - - /** - * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateUserRequest.verify|verify} messages. - * @param message UpdateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateUserRequest.verify|verify} messages. - * @param message UpdateUserRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateUserRequest - * @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.UpdateUserRequest; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateUserRequest - * @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.UpdateUserRequest; - - /** - * Verifies an UpdateUserRequest 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 UpdateUserRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateUserRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateUserRequest; - - /** - * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. - * @param message UpdateUserRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateUserRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateUserRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateUserRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListUsersRequest. */ - interface IListUsersRequest { - - /** ListUsersRequest parent */ - parent?: (string|null); - - /** ListUsersRequest pageSize */ - pageSize?: (number|null); - - /** ListUsersRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListUsersRequest. */ - class ListUsersRequest implements IListUsersRequest { - - /** - * Constructs a new ListUsersRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListUsersRequest); - - /** ListUsersRequest parent. */ - public parent: string; - - /** ListUsersRequest pageSize. */ - public pageSize: number; - - /** ListUsersRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListUsersRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUsersRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListUsersRequest): google.shopping.merchant.accounts.v1beta.ListUsersRequest; - - /** - * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersRequest.verify|verify} messages. - * @param message ListUsersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersRequest.verify|verify} messages. - * @param message ListUsersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListUsersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUsersRequest - * @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.ListUsersRequest; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUsersRequest - * @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.ListUsersRequest; - - /** - * Verifies a ListUsersRequest 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 ListUsersRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUsersRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListUsersRequest; - - /** - * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. - * @param message ListUsersRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListUsersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListUsersRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListUsersRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListUsersResponse. */ - interface IListUsersResponse { - - /** ListUsersResponse users */ - users?: (google.shopping.merchant.accounts.v1beta.IUser[]|null); - - /** ListUsersResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListUsersResponse. */ - class ListUsersResponse implements IListUsersResponse { - - /** - * Constructs a new ListUsersResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListUsersResponse); - - /** ListUsersResponse users. */ - public users: google.shopping.merchant.accounts.v1beta.IUser[]; - - /** ListUsersResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListUsersResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListUsersResponse instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListUsersResponse): google.shopping.merchant.accounts.v1beta.ListUsersResponse; - - /** - * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersResponse.verify|verify} messages. - * @param message ListUsersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersResponse.verify|verify} messages. - * @param message ListUsersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListUsersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListUsersResponse - * @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.ListUsersResponse; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListUsersResponse - * @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.ListUsersResponse; - - /** - * Verifies a ListUsersResponse 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 ListUsersResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListUsersResponse - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListUsersResponse; - - /** - * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. - * @param message ListUsersResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListUsersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListUsersResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListUsersResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - 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 { - - /** - * Constructs a new BusinessIdentityService 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 BusinessIdentityService 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): BusinessIdentityService; - - /** - * Calls GetBusinessIdentity. - * @param request GetBusinessIdentityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BusinessIdentity - */ - public getBusinessIdentity(request: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, callback: google.shopping.merchant.accounts.v1beta.BusinessIdentityService.GetBusinessIdentityCallback): void; - - /** - * Calls GetBusinessIdentity. - * @param request GetBusinessIdentityRequest message or plain object - * @returns Promise - */ - public getBusinessIdentity(request: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest): Promise; - - /** - * Calls UpdateBusinessIdentity. - * @param request UpdateBusinessIdentityRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BusinessIdentity - */ - public updateBusinessIdentity(request: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, callback: google.shopping.merchant.accounts.v1beta.BusinessIdentityService.UpdateBusinessIdentityCallback): void; - - /** - * Calls UpdateBusinessIdentity. - * @param request UpdateBusinessIdentityRequest message or plain object - * @returns Promise - */ - public updateBusinessIdentity(request: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest): Promise; - } - - namespace BusinessIdentityService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessIdentityService|getBusinessIdentity}. - * @param error Error, if any - * @param [response] BusinessIdentity - */ - type GetBusinessIdentityCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.BusinessIdentity) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessIdentityService|updateBusinessIdentity}. - * @param error Error, if any - * @param [response] BusinessIdentity - */ - type UpdateBusinessIdentityCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.BusinessIdentity) => void; - } - - /** Properties of a BusinessIdentity. */ - interface IBusinessIdentity { - - /** BusinessIdentity name */ - name?: (string|null); - - /** BusinessIdentity promotionsConsent */ - promotionsConsent?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent|keyof typeof google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent|null); - - /** BusinessIdentity blackOwned */ - blackOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - - /** BusinessIdentity womenOwned */ - womenOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - - /** BusinessIdentity veteranOwned */ - veteranOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - - /** BusinessIdentity latinoOwned */ - latinoOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - - /** BusinessIdentity smallBusiness */ - smallBusiness?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - } - - /** Represents a BusinessIdentity. */ - class BusinessIdentity implements IBusinessIdentity { - - /** - * Constructs a new BusinessIdentity. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IBusinessIdentity); - - /** BusinessIdentity name. */ - public name: string; - - /** BusinessIdentity promotionsConsent. */ - public promotionsConsent: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent|keyof typeof google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent); - - /** BusinessIdentity blackOwned. */ - public blackOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - - /** BusinessIdentity womenOwned. */ - public womenOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - - /** BusinessIdentity veteranOwned. */ - public veteranOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - - /** BusinessIdentity latinoOwned. */ - public latinoOwned?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - - /** BusinessIdentity smallBusiness. */ - public smallBusiness?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute|null); - - /** - * Creates a new BusinessIdentity instance using the specified properties. - * @param [properties] Properties to set - * @returns BusinessIdentity instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IBusinessIdentity): google.shopping.merchant.accounts.v1beta.BusinessIdentity; - - /** - * Encodes the specified BusinessIdentity message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify|verify} messages. - * @param message BusinessIdentity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IBusinessIdentity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BusinessIdentity message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify|verify} messages. - * @param message BusinessIdentity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IBusinessIdentity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BusinessIdentity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BusinessIdentity - * @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.BusinessIdentity; - - /** - * Decodes a BusinessIdentity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BusinessIdentity - * @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.BusinessIdentity; - - /** - * Verifies a BusinessIdentity 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 BusinessIdentity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BusinessIdentity - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.BusinessIdentity; - - /** - * Creates a plain object from a BusinessIdentity message. Also converts values to other types if specified. - * @param message BusinessIdentity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.BusinessIdentity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BusinessIdentity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BusinessIdentity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BusinessIdentity { - - /** Properties of an IdentityAttribute. */ - interface IIdentityAttribute { - - /** IdentityAttribute identityDeclaration */ - identityDeclaration?: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration|keyof typeof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration|null); - } - - /** Represents an IdentityAttribute. */ - class IdentityAttribute implements IIdentityAttribute { - - /** - * Constructs a new IdentityAttribute. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute); - - /** IdentityAttribute identityDeclaration. */ - public identityDeclaration: (google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration|keyof typeof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration); - - /** - * Creates a new IdentityAttribute instance using the specified properties. - * @param [properties] Properties to set - * @returns IdentityAttribute instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute): google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute; - - /** - * Encodes the specified IdentityAttribute message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify|verify} messages. - * @param message IdentityAttribute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IdentityAttribute message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify|verify} messages. - * @param message IdentityAttribute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IdentityAttribute message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentityAttribute - * @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.BusinessIdentity.IdentityAttribute; - - /** - * Decodes an IdentityAttribute message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentityAttribute - * @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.BusinessIdentity.IdentityAttribute; - - /** - * Verifies an IdentityAttribute 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 IdentityAttribute message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentityAttribute - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute; - - /** - * Creates a plain object from an IdentityAttribute message. Also converts values to other types if specified. - * @param message IdentityAttribute - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IdentityAttribute to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IdentityAttribute - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace IdentityAttribute { - - /** IdentityDeclaration enum. */ - enum IdentityDeclaration { - IDENTITY_DECLARATION_UNSPECIFIED = 0, - SELF_IDENTIFIES_AS = 1, - DOES_NOT_SELF_IDENTIFY_AS = 2 - } - } - - /** PromotionsConsent enum. */ - enum PromotionsConsent { - PROMOTIONS_CONSENT_UNSPECIFIED = 0, - PROMOTIONS_CONSENT_GIVEN = 1, - PROMOTIONS_CONSENT_DENIED = 2 - } - } - - /** Properties of a GetBusinessIdentityRequest. */ - interface IGetBusinessIdentityRequest { - - /** GetBusinessIdentityRequest name */ - name?: (string|null); - } - - /** Represents a GetBusinessIdentityRequest. */ - class GetBusinessIdentityRequest implements IGetBusinessIdentityRequest { - - /** - * Constructs a new GetBusinessIdentityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest); - - /** GetBusinessIdentityRequest name. */ - public name: string; - - /** - * Creates a new GetBusinessIdentityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBusinessIdentityRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest): google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest; - - /** - * Encodes the specified GetBusinessIdentityRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest.verify|verify} messages. - * @param message GetBusinessIdentityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBusinessIdentityRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest.verify|verify} messages. - * @param message GetBusinessIdentityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBusinessIdentityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBusinessIdentityRequest - * @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.GetBusinessIdentityRequest; - - /** - * Decodes a GetBusinessIdentityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBusinessIdentityRequest - * @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.GetBusinessIdentityRequest; - - /** - * Verifies a GetBusinessIdentityRequest 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 GetBusinessIdentityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBusinessIdentityRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest; - - /** - * Creates a plain object from a GetBusinessIdentityRequest message. Also converts values to other types if specified. - * @param message GetBusinessIdentityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBusinessIdentityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBusinessIdentityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBusinessIdentityRequest. */ - interface IUpdateBusinessIdentityRequest { - - /** UpdateBusinessIdentityRequest businessIdentity */ - businessIdentity?: (google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null); - - /** UpdateBusinessIdentityRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateBusinessIdentityRequest. */ - class UpdateBusinessIdentityRequest implements IUpdateBusinessIdentityRequest { - - /** - * Constructs a new UpdateBusinessIdentityRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest); - - /** UpdateBusinessIdentityRequest businessIdentity. */ - public businessIdentity?: (google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null); - - /** UpdateBusinessIdentityRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateBusinessIdentityRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBusinessIdentityRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest): google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest; - - /** - * Encodes the specified UpdateBusinessIdentityRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.verify|verify} messages. - * @param message UpdateBusinessIdentityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBusinessIdentityRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.verify|verify} messages. - * @param message UpdateBusinessIdentityRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBusinessIdentityRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBusinessIdentityRequest - * @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.UpdateBusinessIdentityRequest; - - /** - * Decodes an UpdateBusinessIdentityRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBusinessIdentityRequest - * @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.UpdateBusinessIdentityRequest; - - /** - * Verifies an UpdateBusinessIdentityRequest 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 UpdateBusinessIdentityRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBusinessIdentityRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest; - - /** - * Creates a plain object from an UpdateBusinessIdentityRequest message. Also converts values to other types if specified. - * @param message UpdateBusinessIdentityRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBusinessIdentityRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBusinessIdentityRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a BusinessInfoService */ - class BusinessInfoService extends $protobuf.rpc.Service { - - /** - * Constructs a new BusinessInfoService 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 BusinessInfoService 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): BusinessInfoService; - - /** - * Calls GetBusinessInfo. - * @param request GetBusinessInfoRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BusinessInfo - */ - public getBusinessInfo(request: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, callback: google.shopping.merchant.accounts.v1beta.BusinessInfoService.GetBusinessInfoCallback): void; - - /** - * Calls GetBusinessInfo. - * @param request GetBusinessInfoRequest message or plain object - * @returns Promise - */ - public getBusinessInfo(request: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest): Promise; - - /** - * Calls UpdateBusinessInfo. - * @param request UpdateBusinessInfoRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BusinessInfo - */ - public updateBusinessInfo(request: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, callback: google.shopping.merchant.accounts.v1beta.BusinessInfoService.UpdateBusinessInfoCallback): void; - - /** - * Calls UpdateBusinessInfo. - * @param request UpdateBusinessInfoRequest message or plain object - * @returns Promise - */ - public updateBusinessInfo(request: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest): Promise; - } - - namespace BusinessInfoService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessInfoService|getBusinessInfo}. - * @param error Error, if any - * @param [response] BusinessInfo - */ - type GetBusinessInfoCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.BusinessInfo) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessInfoService|updateBusinessInfo}. - * @param error Error, if any - * @param [response] BusinessInfo - */ - type UpdateBusinessInfoCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.BusinessInfo) => void; - } - - /** Properties of a BusinessInfo. */ - interface IBusinessInfo { - - /** BusinessInfo name */ - name?: (string|null); - - /** BusinessInfo address */ - address?: (google.type.IPostalAddress|null); - - /** BusinessInfo phone */ - phone?: (google.type.IPhoneNumber|null); - - /** BusinessInfo phoneVerificationState */ - phoneVerificationState?: (google.shopping.merchant.accounts.v1beta.PhoneVerificationState|keyof typeof google.shopping.merchant.accounts.v1beta.PhoneVerificationState|null); - - /** BusinessInfo customerService */ - customerService?: (google.shopping.merchant.accounts.v1beta.ICustomerService|null); - - /** BusinessInfo koreanBusinessRegistrationNumber */ - koreanBusinessRegistrationNumber?: (string|null); - } - - /** Represents a BusinessInfo. */ - class BusinessInfo implements IBusinessInfo { - - /** - * Constructs a new BusinessInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IBusinessInfo); - - /** BusinessInfo name. */ - public name: string; - - /** BusinessInfo address. */ - public address?: (google.type.IPostalAddress|null); - - /** BusinessInfo phone. */ - public phone?: (google.type.IPhoneNumber|null); - - /** BusinessInfo phoneVerificationState. */ - public phoneVerificationState?: (google.shopping.merchant.accounts.v1beta.PhoneVerificationState|keyof typeof google.shopping.merchant.accounts.v1beta.PhoneVerificationState|null); - - /** BusinessInfo customerService. */ - public customerService?: (google.shopping.merchant.accounts.v1beta.ICustomerService|null); - - /** BusinessInfo koreanBusinessRegistrationNumber. */ - public koreanBusinessRegistrationNumber?: (string|null); - - /** BusinessInfo _address. */ - public _address?: "address"; - - /** BusinessInfo _phone. */ - public _phone?: "phone"; - - /** BusinessInfo _phoneVerificationState. */ - public _phoneVerificationState?: "phoneVerificationState"; - - /** BusinessInfo _customerService. */ - public _customerService?: "customerService"; - - /** BusinessInfo _koreanBusinessRegistrationNumber. */ - public _koreanBusinessRegistrationNumber?: "koreanBusinessRegistrationNumber"; - - /** - * Creates a new BusinessInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns BusinessInfo instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IBusinessInfo): google.shopping.merchant.accounts.v1beta.BusinessInfo; - - /** - * Encodes the specified BusinessInfo message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessInfo.verify|verify} messages. - * @param message BusinessInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IBusinessInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BusinessInfo message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessInfo.verify|verify} messages. - * @param message BusinessInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IBusinessInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BusinessInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BusinessInfo - * @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.BusinessInfo; - - /** - * Decodes a BusinessInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BusinessInfo - * @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.BusinessInfo; - - /** - * Verifies a BusinessInfo 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 BusinessInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BusinessInfo - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.BusinessInfo; - - /** - * Creates a plain object from a BusinessInfo message. Also converts values to other types if specified. - * @param message BusinessInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.BusinessInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BusinessInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BusinessInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBusinessInfoRequest. */ - interface IGetBusinessInfoRequest { - - /** GetBusinessInfoRequest name */ - name?: (string|null); - } - - /** Represents a GetBusinessInfoRequest. */ - class GetBusinessInfoRequest implements IGetBusinessInfoRequest { - - /** - * Constructs a new GetBusinessInfoRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest); - - /** GetBusinessInfoRequest name. */ - public name: string; - - /** - * Creates a new GetBusinessInfoRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBusinessInfoRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest): google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest; - - /** - * Encodes the specified GetBusinessInfoRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest.verify|verify} messages. - * @param message GetBusinessInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBusinessInfoRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest.verify|verify} messages. - * @param message GetBusinessInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBusinessInfoRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBusinessInfoRequest - * @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.GetBusinessInfoRequest; - - /** - * Decodes a GetBusinessInfoRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBusinessInfoRequest - * @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.GetBusinessInfoRequest; - - /** - * Verifies a GetBusinessInfoRequest 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 GetBusinessInfoRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBusinessInfoRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest; - - /** - * Creates a plain object from a GetBusinessInfoRequest message. Also converts values to other types if specified. - * @param message GetBusinessInfoRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBusinessInfoRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBusinessInfoRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBusinessInfoRequest. */ - interface IUpdateBusinessInfoRequest { - - /** UpdateBusinessInfoRequest businessInfo */ - businessInfo?: (google.shopping.merchant.accounts.v1beta.IBusinessInfo|null); - - /** UpdateBusinessInfoRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateBusinessInfoRequest. */ - class UpdateBusinessInfoRequest implements IUpdateBusinessInfoRequest { - - /** - * Constructs a new UpdateBusinessInfoRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest); - - /** UpdateBusinessInfoRequest businessInfo. */ - public businessInfo?: (google.shopping.merchant.accounts.v1beta.IBusinessInfo|null); - - /** UpdateBusinessInfoRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateBusinessInfoRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBusinessInfoRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest): google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest; - - /** - * Encodes the specified UpdateBusinessInfoRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.verify|verify} messages. - * @param message UpdateBusinessInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBusinessInfoRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.verify|verify} messages. - * @param message UpdateBusinessInfoRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBusinessInfoRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBusinessInfoRequest - * @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.UpdateBusinessInfoRequest; - - /** - * Decodes an UpdateBusinessInfoRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBusinessInfoRequest - * @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.UpdateBusinessInfoRequest; - - /** - * Verifies an UpdateBusinessInfoRequest 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 UpdateBusinessInfoRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBusinessInfoRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest; - - /** - * Creates a plain object from an UpdateBusinessInfoRequest message. Also converts values to other types if specified. - * @param message UpdateBusinessInfoRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBusinessInfoRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBusinessInfoRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomerService. */ - interface ICustomerService { - - /** CustomerService uri */ - uri?: (string|null); - - /** CustomerService email */ - email?: (string|null); - - /** CustomerService phone */ - phone?: (google.type.IPhoneNumber|null); - } - - /** Represents a CustomerService. */ - class CustomerService implements ICustomerService { - - /** - * Constructs a new CustomerService. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ICustomerService); - - /** CustomerService uri. */ - public uri?: (string|null); - - /** CustomerService email. */ - public email?: (string|null); - - /** CustomerService phone. */ - public phone?: (google.type.IPhoneNumber|null); - - /** CustomerService _uri. */ - public _uri?: "uri"; - - /** CustomerService _email. */ - public _email?: "email"; - - /** CustomerService _phone. */ - public _phone?: "phone"; - - /** - * Creates a new CustomerService instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomerService instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ICustomerService): google.shopping.merchant.accounts.v1beta.CustomerService; - - /** - * Encodes the specified CustomerService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CustomerService.verify|verify} messages. - * @param message CustomerService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ICustomerService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomerService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CustomerService.verify|verify} messages. - * @param message CustomerService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICustomerService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomerService message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomerService - * @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.CustomerService; - - /** - * Decodes a CustomerService message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomerService - * @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.CustomerService; - - /** - * Verifies a CustomerService 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 CustomerService message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomerService - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CustomerService; - - /** - * Creates a plain object from a CustomerService message. Also converts values to other types if specified. - * @param message CustomerService - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.CustomerService, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomerService to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomerService - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** PhoneVerificationState enum. */ - enum PhoneVerificationState { - PHONE_VERIFICATION_STATE_UNSPECIFIED = 0, - PHONE_VERIFICATION_STATE_VERIFIED = 1, - PHONE_VERIFICATION_STATE_UNVERIFIED = 2 - } - - /** Represents an EmailPreferencesService */ - class EmailPreferencesService extends $protobuf.rpc.Service { - - /** - * Constructs a new EmailPreferencesService 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 EmailPreferencesService 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): EmailPreferencesService; - - /** - * Calls GetEmailPreferences. - * @param request GetEmailPreferencesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EmailPreferences - */ - public getEmailPreferences(request: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, callback: google.shopping.merchant.accounts.v1beta.EmailPreferencesService.GetEmailPreferencesCallback): void; - - /** - * Calls GetEmailPreferences. - * @param request GetEmailPreferencesRequest message or plain object - * @returns Promise - */ - public getEmailPreferences(request: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest): Promise; - - /** - * Calls UpdateEmailPreferences. - * @param request UpdateEmailPreferencesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EmailPreferences - */ - public updateEmailPreferences(request: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, callback: google.shopping.merchant.accounts.v1beta.EmailPreferencesService.UpdateEmailPreferencesCallback): void; - - /** - * Calls UpdateEmailPreferences. - * @param request UpdateEmailPreferencesRequest message or plain object - * @returns Promise - */ - public updateEmailPreferences(request: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest): Promise; - } - - namespace EmailPreferencesService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.EmailPreferencesService|getEmailPreferences}. - * @param error Error, if any - * @param [response] EmailPreferences - */ - type GetEmailPreferencesCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.EmailPreferences) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.EmailPreferencesService|updateEmailPreferences}. - * @param error Error, if any - * @param [response] EmailPreferences - */ - type UpdateEmailPreferencesCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.EmailPreferences) => void; - } - - /** Properties of an EmailPreferences. */ - interface IEmailPreferences { - - /** EmailPreferences name */ - name?: (string|null); - - /** EmailPreferences newsAndTips */ - newsAndTips?: (google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState|keyof typeof google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState|null); - } - - /** Represents an EmailPreferences. */ - class EmailPreferences implements IEmailPreferences { - - /** - * Constructs a new EmailPreferences. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IEmailPreferences); - - /** EmailPreferences name. */ - public name: string; - - /** EmailPreferences newsAndTips. */ - public newsAndTips: (google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState|keyof typeof google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState); - - /** - * Creates a new EmailPreferences instance using the specified properties. - * @param [properties] Properties to set - * @returns EmailPreferences instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IEmailPreferences): google.shopping.merchant.accounts.v1beta.EmailPreferences; - - /** - * Encodes the specified EmailPreferences message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EmailPreferences.verify|verify} messages. - * @param message EmailPreferences message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EmailPreferences.verify|verify} messages. - * @param message EmailPreferences message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EmailPreferences message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EmailPreferences - * @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.EmailPreferences; - - /** - * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EmailPreferences - * @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.EmailPreferences; - - /** - * Verifies an EmailPreferences 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 EmailPreferences message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EmailPreferences - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.EmailPreferences; - - /** - * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. - * @param message EmailPreferences - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.EmailPreferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EmailPreferences to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EmailPreferences - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EmailPreferences { - - /** OptInState enum. */ - enum OptInState { - OPT_IN_STATE_UNSPECIFIED = 0, - OPTED_OUT = 1, - OPTED_IN = 2, - UNCONFIRMED = 3 - } - } - - /** Properties of a GetEmailPreferencesRequest. */ - interface IGetEmailPreferencesRequest { - - /** GetEmailPreferencesRequest name */ - name?: (string|null); - } - - /** Represents a GetEmailPreferencesRequest. */ - class GetEmailPreferencesRequest implements IGetEmailPreferencesRequest { - - /** - * Constructs a new GetEmailPreferencesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest); - - /** GetEmailPreferencesRequest name. */ - public name: string; - - /** - * Creates a new GetEmailPreferencesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEmailPreferencesRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest): google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest; - - /** - * Encodes the specified GetEmailPreferencesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest.verify|verify} messages. - * @param message GetEmailPreferencesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEmailPreferencesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest.verify|verify} messages. - * @param message GetEmailPreferencesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEmailPreferencesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEmailPreferencesRequest - * @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.GetEmailPreferencesRequest; - - /** - * Decodes a GetEmailPreferencesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEmailPreferencesRequest - * @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.GetEmailPreferencesRequest; - - /** - * Verifies a GetEmailPreferencesRequest 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 GetEmailPreferencesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEmailPreferencesRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest; - - /** - * Creates a plain object from a GetEmailPreferencesRequest message. Also converts values to other types if specified. - * @param message GetEmailPreferencesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEmailPreferencesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEmailPreferencesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateEmailPreferencesRequest. */ - interface IUpdateEmailPreferencesRequest { - - /** UpdateEmailPreferencesRequest emailPreferences */ - emailPreferences?: (google.shopping.merchant.accounts.v1beta.IEmailPreferences|null); - - /** UpdateEmailPreferencesRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateEmailPreferencesRequest. */ - class UpdateEmailPreferencesRequest implements IUpdateEmailPreferencesRequest { - - /** - * Constructs a new UpdateEmailPreferencesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest); - - /** UpdateEmailPreferencesRequest emailPreferences. */ - public emailPreferences?: (google.shopping.merchant.accounts.v1beta.IEmailPreferences|null); - - /** UpdateEmailPreferencesRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateEmailPreferencesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateEmailPreferencesRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest): google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest; - - /** - * Encodes the specified UpdateEmailPreferencesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.verify|verify} messages. - * @param message UpdateEmailPreferencesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateEmailPreferencesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.verify|verify} messages. - * @param message UpdateEmailPreferencesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateEmailPreferencesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateEmailPreferencesRequest - * @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.UpdateEmailPreferencesRequest; - - /** - * Decodes an UpdateEmailPreferencesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateEmailPreferencesRequest - * @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.UpdateEmailPreferencesRequest; - - /** - * Verifies an UpdateEmailPreferencesRequest 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 UpdateEmailPreferencesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateEmailPreferencesRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest; - - /** - * Creates a plain object from an UpdateEmailPreferencesRequest message. Also converts values to other types if specified. - * @param message UpdateEmailPreferencesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateEmailPreferencesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateEmailPreferencesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a HomepageService */ - class HomepageService extends $protobuf.rpc.Service { - - /** - * Constructs a new HomepageService 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 HomepageService 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): HomepageService; - - /** - * Calls GetHomepage. - * @param request GetHomepageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Homepage - */ - public getHomepage(request: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, callback: google.shopping.merchant.accounts.v1beta.HomepageService.GetHomepageCallback): void; - - /** - * Calls GetHomepage. - * @param request GetHomepageRequest message or plain object - * @returns Promise - */ - public getHomepage(request: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest): Promise; - - /** - * Calls UpdateHomepage. - * @param request UpdateHomepageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Homepage - */ - public updateHomepage(request: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, callback: google.shopping.merchant.accounts.v1beta.HomepageService.UpdateHomepageCallback): void; - - /** - * Calls UpdateHomepage. - * @param request UpdateHomepageRequest message or plain object - * @returns Promise - */ - public updateHomepage(request: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest): Promise; - - /** - * Calls ClaimHomepage. - * @param request ClaimHomepageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Homepage - */ - public claimHomepage(request: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, callback: google.shopping.merchant.accounts.v1beta.HomepageService.ClaimHomepageCallback): void; - - /** - * Calls ClaimHomepage. - * @param request ClaimHomepageRequest message or plain object - * @returns Promise - */ - public claimHomepage(request: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest): Promise; - - /** - * Calls UnclaimHomepage. - * @param request UnclaimHomepageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Homepage - */ - public unclaimHomepage(request: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, callback: google.shopping.merchant.accounts.v1beta.HomepageService.UnclaimHomepageCallback): void; - - /** - * Calls UnclaimHomepage. - * @param request UnclaimHomepageRequest message or plain object - * @returns Promise - */ - public unclaimHomepage(request: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest): Promise; - } - - namespace HomepageService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|getHomepage}. - * @param error Error, if any - * @param [response] Homepage - */ - type GetHomepageCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Homepage) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|updateHomepage}. - * @param error Error, if any - * @param [response] Homepage - */ - type UpdateHomepageCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Homepage) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|claimHomepage}. - * @param error Error, if any - * @param [response] Homepage - */ - type ClaimHomepageCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Homepage) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|unclaimHomepage}. - * @param error Error, if any - * @param [response] Homepage - */ - type UnclaimHomepageCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Homepage) => void; - } - - /** Properties of a Homepage. */ - interface IHomepage { - - /** Homepage name */ - name?: (string|null); - - /** Homepage uri */ - uri?: (string|null); - - /** Homepage claimed */ - claimed?: (boolean|null); - } - - /** Represents a Homepage. */ - class Homepage implements IHomepage { - - /** - * Constructs a new Homepage. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IHomepage); - - /** Homepage name. */ - public name: string; - - /** Homepage uri. */ - public uri?: (string|null); - - /** Homepage claimed. */ - public claimed: boolean; - - /** Homepage _uri. */ - public _uri?: "uri"; - - /** - * Creates a new Homepage instance using the specified properties. - * @param [properties] Properties to set - * @returns Homepage instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IHomepage): google.shopping.merchant.accounts.v1beta.Homepage; - - /** - * Encodes the specified Homepage message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Homepage.verify|verify} messages. - * @param message Homepage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IHomepage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Homepage message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Homepage.verify|verify} messages. - * @param message Homepage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IHomepage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Homepage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Homepage - * @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.Homepage; - - /** - * Decodes a Homepage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Homepage - * @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.Homepage; - - /** - * Verifies a Homepage 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 Homepage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Homepage - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Homepage; - - /** - * Creates a plain object from a Homepage message. Also converts values to other types if specified. - * @param message Homepage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Homepage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Homepage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Homepage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetHomepageRequest. */ - interface IGetHomepageRequest { - - /** GetHomepageRequest name */ - name?: (string|null); - } - - /** Represents a GetHomepageRequest. */ - class GetHomepageRequest implements IGetHomepageRequest { - - /** - * Constructs a new GetHomepageRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest); - - /** GetHomepageRequest name. */ - public name: string; - - /** - * Creates a new GetHomepageRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetHomepageRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest): google.shopping.merchant.accounts.v1beta.GetHomepageRequest; - - /** - * Encodes the specified GetHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetHomepageRequest.verify|verify} messages. - * @param message GetHomepageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetHomepageRequest.verify|verify} messages. - * @param message GetHomepageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetHomepageRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetHomepageRequest - * @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.GetHomepageRequest; - - /** - * Decodes a GetHomepageRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetHomepageRequest - * @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.GetHomepageRequest; - - /** - * Verifies a GetHomepageRequest 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 GetHomepageRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetHomepageRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetHomepageRequest; - - /** - * Creates a plain object from a GetHomepageRequest message. Also converts values to other types if specified. - * @param message GetHomepageRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetHomepageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetHomepageRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetHomepageRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateHomepageRequest. */ - interface IUpdateHomepageRequest { - - /** UpdateHomepageRequest homepage */ - homepage?: (google.shopping.merchant.accounts.v1beta.IHomepage|null); - - /** UpdateHomepageRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateHomepageRequest. */ - class UpdateHomepageRequest implements IUpdateHomepageRequest { - - /** - * Constructs a new UpdateHomepageRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest); - - /** UpdateHomepageRequest homepage. */ - public homepage?: (google.shopping.merchant.accounts.v1beta.IHomepage|null); - - /** UpdateHomepageRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateHomepageRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateHomepageRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest): google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest; - - /** - * Encodes the specified UpdateHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.verify|verify} messages. - * @param message UpdateHomepageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.verify|verify} messages. - * @param message UpdateHomepageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateHomepageRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateHomepageRequest - * @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.UpdateHomepageRequest; - - /** - * Decodes an UpdateHomepageRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateHomepageRequest - * @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.UpdateHomepageRequest; - - /** - * Verifies an UpdateHomepageRequest 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 UpdateHomepageRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateHomepageRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest; - - /** - * Creates a plain object from an UpdateHomepageRequest message. Also converts values to other types if specified. - * @param message UpdateHomepageRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateHomepageRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateHomepageRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClaimHomepageRequest. */ - interface IClaimHomepageRequest { - - /** ClaimHomepageRequest name */ - name?: (string|null); - } - - /** Represents a ClaimHomepageRequest. */ - class ClaimHomepageRequest implements IClaimHomepageRequest { - - /** - * Constructs a new ClaimHomepageRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest); - - /** ClaimHomepageRequest name. */ - public name: string; - - /** - * Creates a new ClaimHomepageRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ClaimHomepageRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest): google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest; - - /** - * Encodes the specified ClaimHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest.verify|verify} messages. - * @param message ClaimHomepageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClaimHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest.verify|verify} messages. - * @param message ClaimHomepageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClaimHomepageRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClaimHomepageRequest - * @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.ClaimHomepageRequest; - - /** - * Decodes a ClaimHomepageRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClaimHomepageRequest - * @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.ClaimHomepageRequest; - - /** - * Verifies a ClaimHomepageRequest 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 ClaimHomepageRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClaimHomepageRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest; - - /** - * Creates a plain object from a ClaimHomepageRequest message. Also converts values to other types if specified. - * @param message ClaimHomepageRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClaimHomepageRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClaimHomepageRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UnclaimHomepageRequest. */ - interface IUnclaimHomepageRequest { - - /** UnclaimHomepageRequest name */ - name?: (string|null); - } - - /** Represents an UnclaimHomepageRequest. */ - class UnclaimHomepageRequest implements IUnclaimHomepageRequest { - - /** - * Constructs a new UnclaimHomepageRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest); - - /** UnclaimHomepageRequest name. */ - public name: string; - - /** - * Creates a new UnclaimHomepageRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UnclaimHomepageRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest): google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest; - - /** - * Encodes the specified UnclaimHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest.verify|verify} messages. - * @param message UnclaimHomepageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UnclaimHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest.verify|verify} messages. - * @param message UnclaimHomepageRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UnclaimHomepageRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UnclaimHomepageRequest - * @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.UnclaimHomepageRequest; - - /** - * Decodes an UnclaimHomepageRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UnclaimHomepageRequest - * @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.UnclaimHomepageRequest; - - /** - * Verifies an UnclaimHomepageRequest 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 UnclaimHomepageRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UnclaimHomepageRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest; - - /** - * Creates a plain object from an UnclaimHomepageRequest message. Also converts values to other types if specified. - * @param message UnclaimHomepageRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UnclaimHomepageRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UnclaimHomepageRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents an OnlineReturnPolicyService */ - class OnlineReturnPolicyService extends $protobuf.rpc.Service { - - /** - * Constructs a new OnlineReturnPolicyService 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 OnlineReturnPolicyService 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): OnlineReturnPolicyService; - - /** - * Calls GetOnlineReturnPolicy. - * @param request GetOnlineReturnPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and OnlineReturnPolicy - */ - public getOnlineReturnPolicy(request: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, callback: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.GetOnlineReturnPolicyCallback): void; - - /** - * Calls GetOnlineReturnPolicy. - * @param request GetOnlineReturnPolicyRequest message or plain object - * @returns Promise - */ - public getOnlineReturnPolicy(request: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest): Promise; - - /** - * Calls ListOnlineReturnPolicies. - * @param request ListOnlineReturnPoliciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOnlineReturnPoliciesResponse - */ - public listOnlineReturnPolicies(request: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, callback: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.ListOnlineReturnPoliciesCallback): void; - - /** - * Calls ListOnlineReturnPolicies. - * @param request ListOnlineReturnPoliciesRequest message or plain object - * @returns Promise - */ - public listOnlineReturnPolicies(request: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest): Promise; - } - - namespace OnlineReturnPolicyService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService|getOnlineReturnPolicy}. - * @param error Error, if any - * @param [response] OnlineReturnPolicy - */ - type GetOnlineReturnPolicyCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService|listOnlineReturnPolicies}. - * @param error Error, if any - * @param [response] ListOnlineReturnPoliciesResponse - */ - type ListOnlineReturnPoliciesCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse) => void; - } - - /** Properties of a GetOnlineReturnPolicyRequest. */ - interface IGetOnlineReturnPolicyRequest { - - /** GetOnlineReturnPolicyRequest name */ - name?: (string|null); - } - - /** Represents a GetOnlineReturnPolicyRequest. */ - class GetOnlineReturnPolicyRequest implements IGetOnlineReturnPolicyRequest { - - /** - * Constructs a new GetOnlineReturnPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest); - - /** GetOnlineReturnPolicyRequest name. */ - public name: string; - - /** - * Creates a new GetOnlineReturnPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOnlineReturnPolicyRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest): google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest; - - /** - * Encodes the specified GetOnlineReturnPolicyRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest.verify|verify} messages. - * @param message GetOnlineReturnPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOnlineReturnPolicyRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest.verify|verify} messages. - * @param message GetOnlineReturnPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOnlineReturnPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOnlineReturnPolicyRequest - * @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.GetOnlineReturnPolicyRequest; - - /** - * Decodes a GetOnlineReturnPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOnlineReturnPolicyRequest - * @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.GetOnlineReturnPolicyRequest; - - /** - * Verifies a GetOnlineReturnPolicyRequest 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 GetOnlineReturnPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOnlineReturnPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest; - - /** - * Creates a plain object from a GetOnlineReturnPolicyRequest message. Also converts values to other types if specified. - * @param message GetOnlineReturnPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOnlineReturnPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOnlineReturnPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOnlineReturnPoliciesRequest. */ - interface IListOnlineReturnPoliciesRequest { - - /** ListOnlineReturnPoliciesRequest parent */ - parent?: (string|null); - - /** ListOnlineReturnPoliciesRequest pageSize */ - pageSize?: (number|null); - - /** ListOnlineReturnPoliciesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOnlineReturnPoliciesRequest. */ - class ListOnlineReturnPoliciesRequest implements IListOnlineReturnPoliciesRequest { - - /** - * Constructs a new ListOnlineReturnPoliciesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest); - - /** ListOnlineReturnPoliciesRequest parent. */ - public parent: string; - - /** ListOnlineReturnPoliciesRequest pageSize. */ - public pageSize: number; - - /** ListOnlineReturnPoliciesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOnlineReturnPoliciesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOnlineReturnPoliciesRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest): google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest; - - /** - * Encodes the specified ListOnlineReturnPoliciesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest.verify|verify} messages. - * @param message ListOnlineReturnPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOnlineReturnPoliciesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest.verify|verify} messages. - * @param message ListOnlineReturnPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOnlineReturnPoliciesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOnlineReturnPoliciesRequest - * @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.ListOnlineReturnPoliciesRequest; - - /** - * Decodes a ListOnlineReturnPoliciesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOnlineReturnPoliciesRequest - * @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.ListOnlineReturnPoliciesRequest; - - /** - * Verifies a ListOnlineReturnPoliciesRequest 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 ListOnlineReturnPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOnlineReturnPoliciesRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest; - - /** - * Creates a plain object from a ListOnlineReturnPoliciesRequest message. Also converts values to other types if specified. - * @param message ListOnlineReturnPoliciesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOnlineReturnPoliciesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOnlineReturnPoliciesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOnlineReturnPoliciesResponse. */ - interface IListOnlineReturnPoliciesResponse { - - /** ListOnlineReturnPoliciesResponse onlineReturnPolicies */ - onlineReturnPolicies?: (google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[]|null); - - /** ListOnlineReturnPoliciesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOnlineReturnPoliciesResponse. */ - class ListOnlineReturnPoliciesResponse implements IListOnlineReturnPoliciesResponse { - - /** - * Constructs a new ListOnlineReturnPoliciesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse); - - /** ListOnlineReturnPoliciesResponse onlineReturnPolicies. */ - public onlineReturnPolicies: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[]; - - /** ListOnlineReturnPoliciesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOnlineReturnPoliciesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOnlineReturnPoliciesResponse instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse): google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse; - - /** - * Encodes the specified ListOnlineReturnPoliciesResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.verify|verify} messages. - * @param message ListOnlineReturnPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOnlineReturnPoliciesResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.verify|verify} messages. - * @param message ListOnlineReturnPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOnlineReturnPoliciesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOnlineReturnPoliciesResponse - * @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.ListOnlineReturnPoliciesResponse; - - /** - * Decodes a ListOnlineReturnPoliciesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOnlineReturnPoliciesResponse - * @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.ListOnlineReturnPoliciesResponse; - - /** - * Verifies a ListOnlineReturnPoliciesResponse 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 ListOnlineReturnPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOnlineReturnPoliciesResponse - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse; - - /** - * Creates a plain object from a ListOnlineReturnPoliciesResponse message. Also converts values to other types if specified. - * @param message ListOnlineReturnPoliciesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOnlineReturnPoliciesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOnlineReturnPoliciesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OnlineReturnPolicy. */ - interface IOnlineReturnPolicy { - - /** OnlineReturnPolicy name */ - name?: (string|null); - - /** OnlineReturnPolicy returnPolicyId */ - returnPolicyId?: (string|null); - - /** OnlineReturnPolicy label */ - label?: (string|null); - - /** OnlineReturnPolicy countries */ - countries?: (string[]|null); - - /** OnlineReturnPolicy policy */ - policy?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy|null); - - /** OnlineReturnPolicy restockingFee */ - restockingFee?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee|null); - - /** OnlineReturnPolicy returnMethods */ - returnMethods?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod[]|null); - - /** OnlineReturnPolicy itemConditions */ - itemConditions?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition[]|null); - - /** OnlineReturnPolicy returnShippingFee */ - returnShippingFee?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee|null); - - /** OnlineReturnPolicy returnPolicyUri */ - returnPolicyUri?: (string|null); - - /** OnlineReturnPolicy acceptDefectiveOnly */ - acceptDefectiveOnly?: (boolean|null); - - /** OnlineReturnPolicy processRefundDays */ - processRefundDays?: (number|null); - - /** OnlineReturnPolicy acceptExchange */ - acceptExchange?: (boolean|null); - } - - /** Represents an OnlineReturnPolicy. */ - class OnlineReturnPolicy implements IOnlineReturnPolicy { - - /** - * Constructs a new OnlineReturnPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy); - - /** OnlineReturnPolicy name. */ - public name: string; - - /** OnlineReturnPolicy returnPolicyId. */ - public returnPolicyId: string; - - /** OnlineReturnPolicy label. */ - public label: string; - - /** OnlineReturnPolicy countries. */ - public countries: string[]; - - /** OnlineReturnPolicy policy. */ - public policy?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy|null); - - /** OnlineReturnPolicy restockingFee. */ - public restockingFee?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee|null); - - /** OnlineReturnPolicy returnMethods. */ - public returnMethods: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod[]; - - /** OnlineReturnPolicy itemConditions. */ - public itemConditions: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition[]; - - /** OnlineReturnPolicy returnShippingFee. */ - public returnShippingFee?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee|null); - - /** OnlineReturnPolicy returnPolicyUri. */ - public returnPolicyUri: string; - - /** OnlineReturnPolicy acceptDefectiveOnly. */ - public acceptDefectiveOnly?: (boolean|null); - - /** OnlineReturnPolicy processRefundDays. */ - public processRefundDays?: (number|null); - - /** OnlineReturnPolicy acceptExchange. */ - public acceptExchange?: (boolean|null); - - /** OnlineReturnPolicy _acceptDefectiveOnly. */ - public _acceptDefectiveOnly?: "acceptDefectiveOnly"; - - /** OnlineReturnPolicy _processRefundDays. */ - public _processRefundDays?: "processRefundDays"; - - /** OnlineReturnPolicy _acceptExchange. */ - public _acceptExchange?: "acceptExchange"; - - /** - * Creates a new OnlineReturnPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns OnlineReturnPolicy instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy; - - /** - * Encodes the specified OnlineReturnPolicy message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify|verify} messages. - * @param message OnlineReturnPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OnlineReturnPolicy message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify|verify} messages. - * @param message OnlineReturnPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OnlineReturnPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OnlineReturnPolicy - * @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.OnlineReturnPolicy; - - /** - * Decodes an OnlineReturnPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OnlineReturnPolicy - * @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.OnlineReturnPolicy; - - /** - * Verifies an OnlineReturnPolicy 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 OnlineReturnPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OnlineReturnPolicy - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy; - - /** - * Creates a plain object from an OnlineReturnPolicy message. Also converts values to other types if specified. - * @param message OnlineReturnPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OnlineReturnPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OnlineReturnPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace OnlineReturnPolicy { - - /** Properties of a ReturnShippingFee. */ - interface IReturnShippingFee { - - /** ReturnShippingFee type */ - type?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type|keyof typeof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type|null); - - /** ReturnShippingFee fixedFee */ - fixedFee?: (google.shopping.type.IPrice|null); - } - - /** Represents a ReturnShippingFee. */ - class ReturnShippingFee implements IReturnShippingFee { - - /** - * Constructs a new ReturnShippingFee. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee); - - /** ReturnShippingFee type. */ - public type: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type|keyof typeof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type); - - /** ReturnShippingFee fixedFee. */ - public fixedFee?: (google.shopping.type.IPrice|null); - - /** - * Creates a new ReturnShippingFee instance using the specified properties. - * @param [properties] Properties to set - * @returns ReturnShippingFee instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee; - - /** - * Encodes the specified ReturnShippingFee message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify|verify} messages. - * @param message ReturnShippingFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReturnShippingFee message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify|verify} messages. - * @param message ReturnShippingFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReturnShippingFee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReturnShippingFee - * @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.OnlineReturnPolicy.ReturnShippingFee; - - /** - * Decodes a ReturnShippingFee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReturnShippingFee - * @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.OnlineReturnPolicy.ReturnShippingFee; - - /** - * Verifies a ReturnShippingFee 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 ReturnShippingFee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReturnShippingFee - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee; - - /** - * Creates a plain object from a ReturnShippingFee message. Also converts values to other types if specified. - * @param message ReturnShippingFee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReturnShippingFee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReturnShippingFee - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReturnShippingFee { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - FIXED = 1, - CUSTOMER_PAYING_ACTUAL_FEE = 2 - } - } - - /** Properties of a RestockingFee. */ - interface IRestockingFee { - - /** RestockingFee fixedFee */ - fixedFee?: (google.shopping.type.IPrice|null); - - /** RestockingFee microPercent */ - microPercent?: (number|null); - } - - /** Represents a RestockingFee. */ - class RestockingFee implements IRestockingFee { - - /** - * Constructs a new RestockingFee. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee); - - /** RestockingFee fixedFee. */ - public fixedFee?: (google.shopping.type.IPrice|null); - - /** RestockingFee microPercent. */ - public microPercent?: (number|null); - - /** RestockingFee type. */ - public type?: ("fixedFee"|"microPercent"); - - /** - * Creates a new RestockingFee instance using the specified properties. - * @param [properties] Properties to set - * @returns RestockingFee instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee; - - /** - * Encodes the specified RestockingFee message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify|verify} messages. - * @param message RestockingFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestockingFee message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify|verify} messages. - * @param message RestockingFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestockingFee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestockingFee - * @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.OnlineReturnPolicy.RestockingFee; - - /** - * Decodes a RestockingFee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestockingFee - * @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.OnlineReturnPolicy.RestockingFee; - - /** - * Verifies a RestockingFee 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 RestockingFee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestockingFee - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee; - - /** - * Creates a plain object from a RestockingFee message. Also converts values to other types if specified. - * @param message RestockingFee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestockingFee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestockingFee - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy type */ - type?: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type|keyof typeof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type|null); - - /** Policy days */ - days?: (number|Long|string|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy); - - /** Policy type. */ - public type: (google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type|keyof typeof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type); - - /** Policy days. */ - public days: (number|Long|string); - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @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.OnlineReturnPolicy.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @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.OnlineReturnPolicy.Policy; - - /** - * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Policy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Policy { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - NUMBER_OF_DAYS_AFTER_DELIVERY = 1, - NO_RETURNS = 2, - LIFETIME_RETURNS = 3 - } - } - - /** ReturnMethod enum. */ - enum ReturnMethod { - RETURN_METHOD_UNSPECIFIED = 0, - BY_MAIL = 1, - IN_STORE = 2, - AT_A_KIOSK = 3 - } - - /** ItemCondition enum. */ - enum ItemCondition { - ITEM_CONDITION_UNSPECIFIED = 0, - NEW = 1, - USED = 2 - } - } - - /** Represents a ProgramsService */ - class ProgramsService extends $protobuf.rpc.Service { - - /** - * Constructs a new ProgramsService 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 ProgramsService 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): ProgramsService; - - /** - * Calls GetProgram. - * @param request GetProgramRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Program - */ - public getProgram(request: google.shopping.merchant.accounts.v1beta.IGetProgramRequest, callback: google.shopping.merchant.accounts.v1beta.ProgramsService.GetProgramCallback): void; - - /** - * Calls GetProgram. - * @param request GetProgramRequest message or plain object - * @returns Promise - */ - public getProgram(request: google.shopping.merchant.accounts.v1beta.IGetProgramRequest): Promise; - - /** - * Calls ListPrograms. - * @param request ListProgramsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProgramsResponse - */ - public listPrograms(request: google.shopping.merchant.accounts.v1beta.IListProgramsRequest, callback: google.shopping.merchant.accounts.v1beta.ProgramsService.ListProgramsCallback): void; - - /** - * Calls ListPrograms. - * @param request ListProgramsRequest message or plain object - * @returns Promise - */ - public listPrograms(request: google.shopping.merchant.accounts.v1beta.IListProgramsRequest): Promise; - - /** - * Calls EnableProgram. - * @param request EnableProgramRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Program - */ - public enableProgram(request: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, callback: google.shopping.merchant.accounts.v1beta.ProgramsService.EnableProgramCallback): void; - - /** - * Calls EnableProgram. - * @param request EnableProgramRequest message or plain object - * @returns Promise - */ - public enableProgram(request: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest): Promise; - - /** - * Calls DisableProgram. - * @param request DisableProgramRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Program - */ - public disableProgram(request: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, callback: google.shopping.merchant.accounts.v1beta.ProgramsService.DisableProgramCallback): void; - - /** - * Calls DisableProgram. - * @param request DisableProgramRequest message or plain object - * @returns Promise - */ - public disableProgram(request: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest): Promise; - } - - namespace ProgramsService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|getProgram}. - * @param error Error, if any - * @param [response] Program - */ - type GetProgramCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Program) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|listPrograms}. - * @param error Error, if any - * @param [response] ListProgramsResponse - */ - type ListProgramsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListProgramsResponse) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|enableProgram}. - * @param error Error, if any - * @param [response] Program - */ - type EnableProgramCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Program) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|disableProgram}. - * @param error Error, if any - * @param [response] Program - */ - type DisableProgramCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Program) => void; - } - - /** Properties of a Program. */ - interface IProgram { - - /** Program name */ - name?: (string|null); - - /** Program documentationUri */ - documentationUri?: (string|null); - - /** Program state */ - state?: (google.shopping.merchant.accounts.v1beta.Program.State|keyof typeof google.shopping.merchant.accounts.v1beta.Program.State|null); - - /** Program activeRegionCodes */ - activeRegionCodes?: (string[]|null); - - /** Program unmetRequirements */ - unmetRequirements?: (google.shopping.merchant.accounts.v1beta.Program.IRequirement[]|null); - } - - /** Represents a Program. */ - class Program implements IProgram { - - /** - * Constructs a new Program. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IProgram); - - /** Program name. */ - public name: string; - - /** Program documentationUri. */ - public documentationUri: string; - - /** Program state. */ - public state: (google.shopping.merchant.accounts.v1beta.Program.State|keyof typeof google.shopping.merchant.accounts.v1beta.Program.State); - - /** Program activeRegionCodes. */ - public activeRegionCodes: string[]; - - /** Program unmetRequirements. */ - public unmetRequirements: google.shopping.merchant.accounts.v1beta.Program.IRequirement[]; - - /** - * Creates a new Program instance using the specified properties. - * @param [properties] Properties to set - * @returns Program instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IProgram): google.shopping.merchant.accounts.v1beta.Program; - - /** - * Encodes the specified Program message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.verify|verify} messages. - * @param message Program message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IProgram, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Program message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.verify|verify} messages. - * @param message Program message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IProgram, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Program message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Program - * @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.Program; - - /** - * Decodes a Program message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Program - * @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.Program; - - /** - * Verifies a Program 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 Program message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Program - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Program; - - /** - * Creates a plain object from a Program message. Also converts values to other types if specified. - * @param message Program - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Program, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Program to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Program - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Program { - - /** Properties of a Requirement. */ - interface IRequirement { - - /** Requirement title */ - title?: (string|null); - - /** Requirement documentationUri */ - documentationUri?: (string|null); - - /** Requirement affectedRegionCodes */ - affectedRegionCodes?: (string[]|null); - } - - /** Represents a Requirement. */ - class Requirement implements IRequirement { - - /** - * Constructs a new Requirement. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.Program.IRequirement); - - /** Requirement title. */ - public title: string; - - /** Requirement documentationUri. */ - public documentationUri: string; - - /** Requirement affectedRegionCodes. */ - public affectedRegionCodes: string[]; - - /** - * Creates a new Requirement instance using the specified properties. - * @param [properties] Properties to set - * @returns Requirement instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.Program.IRequirement): google.shopping.merchant.accounts.v1beta.Program.Requirement; - - /** - * Encodes the specified Requirement message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.Requirement.verify|verify} messages. - * @param message Requirement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.Program.IRequirement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Requirement message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.Requirement.verify|verify} messages. - * @param message Requirement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Program.IRequirement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Requirement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Requirement - * @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.Program.Requirement; - - /** - * Decodes a Requirement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Requirement - * @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.Program.Requirement; - - /** - * Verifies a Requirement 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 Requirement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Requirement - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Program.Requirement; - - /** - * Creates a plain object from a Requirement message. Also converts values to other types if specified. - * @param message Requirement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Program.Requirement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Requirement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Requirement - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - NOT_ELIGIBLE = 1, - ELIGIBLE = 2, - ENABLED = 3 - } - } - - /** Properties of a GetProgramRequest. */ - interface IGetProgramRequest { - - /** GetProgramRequest name */ - name?: (string|null); - } - - /** Represents a GetProgramRequest. */ - class GetProgramRequest implements IGetProgramRequest { - - /** - * Constructs a new GetProgramRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetProgramRequest); - - /** GetProgramRequest name. */ - public name: string; - - /** - * Creates a new GetProgramRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetProgramRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetProgramRequest): google.shopping.merchant.accounts.v1beta.GetProgramRequest; - - /** - * Encodes the specified GetProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetProgramRequest.verify|verify} messages. - * @param message GetProgramRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetProgramRequest.verify|verify} messages. - * @param message GetProgramRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetProgramRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetProgramRequest - * @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.GetProgramRequest; - - /** - * Decodes a GetProgramRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetProgramRequest - * @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.GetProgramRequest; - - /** - * Verifies a GetProgramRequest 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 GetProgramRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetProgramRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetProgramRequest; - - /** - * Creates a plain object from a GetProgramRequest message. Also converts values to other types if specified. - * @param message GetProgramRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetProgramRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetProgramRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetProgramRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProgramsRequest. */ - interface IListProgramsRequest { - - /** ListProgramsRequest parent */ - parent?: (string|null); - - /** ListProgramsRequest pageSize */ - pageSize?: (number|null); - - /** ListProgramsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListProgramsRequest. */ - class ListProgramsRequest implements IListProgramsRequest { - - /** - * Constructs a new ListProgramsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListProgramsRequest); - - /** ListProgramsRequest parent. */ - public parent: string; - - /** ListProgramsRequest pageSize. */ - public pageSize: number; - - /** ListProgramsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListProgramsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProgramsRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListProgramsRequest): google.shopping.merchant.accounts.v1beta.ListProgramsRequest; - - /** - * Encodes the specified ListProgramsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsRequest.verify|verify} messages. - * @param message ListProgramsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListProgramsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProgramsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsRequest.verify|verify} messages. - * @param message ListProgramsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListProgramsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProgramsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProgramsRequest - * @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.ListProgramsRequest; - - /** - * Decodes a ListProgramsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProgramsRequest - * @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.ListProgramsRequest; - - /** - * Verifies a ListProgramsRequest 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 ListProgramsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProgramsRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListProgramsRequest; - - /** - * Creates a plain object from a ListProgramsRequest message. Also converts values to other types if specified. - * @param message ListProgramsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListProgramsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProgramsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProgramsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProgramsResponse. */ - interface IListProgramsResponse { - - /** ListProgramsResponse programs */ - programs?: (google.shopping.merchant.accounts.v1beta.IProgram[]|null); - - /** ListProgramsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListProgramsResponse. */ - class ListProgramsResponse implements IListProgramsResponse { - - /** - * Constructs a new ListProgramsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListProgramsResponse); - - /** ListProgramsResponse programs. */ - public programs: google.shopping.merchant.accounts.v1beta.IProgram[]; - - /** ListProgramsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListProgramsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProgramsResponse instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListProgramsResponse): google.shopping.merchant.accounts.v1beta.ListProgramsResponse; - - /** - * Encodes the specified ListProgramsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsResponse.verify|verify} messages. - * @param message ListProgramsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListProgramsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProgramsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsResponse.verify|verify} messages. - * @param message ListProgramsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListProgramsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProgramsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProgramsResponse - * @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.ListProgramsResponse; - - /** - * Decodes a ListProgramsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProgramsResponse - * @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.ListProgramsResponse; - - /** - * Verifies a ListProgramsResponse 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 ListProgramsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProgramsResponse - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListProgramsResponse; - - /** - * Creates a plain object from a ListProgramsResponse message. Also converts values to other types if specified. - * @param message ListProgramsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListProgramsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProgramsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProgramsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnableProgramRequest. */ - interface IEnableProgramRequest { - - /** EnableProgramRequest name */ - name?: (string|null); - } - - /** Represents an EnableProgramRequest. */ - class EnableProgramRequest implements IEnableProgramRequest { - - /** - * Constructs a new EnableProgramRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest); - - /** EnableProgramRequest name. */ - public name: string; - - /** - * Creates a new EnableProgramRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EnableProgramRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest): google.shopping.merchant.accounts.v1beta.EnableProgramRequest; - - /** - * Encodes the specified EnableProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EnableProgramRequest.verify|verify} messages. - * @param message EnableProgramRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnableProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EnableProgramRequest.verify|verify} messages. - * @param message EnableProgramRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnableProgramRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnableProgramRequest - * @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.EnableProgramRequest; - - /** - * Decodes an EnableProgramRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnableProgramRequest - * @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.EnableProgramRequest; - - /** - * Verifies an EnableProgramRequest 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 EnableProgramRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnableProgramRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.EnableProgramRequest; - - /** - * Creates a plain object from an EnableProgramRequest message. Also converts values to other types if specified. - * @param message EnableProgramRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.EnableProgramRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnableProgramRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnableProgramRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisableProgramRequest. */ - interface IDisableProgramRequest { - - /** DisableProgramRequest name */ - name?: (string|null); - } - - /** Represents a DisableProgramRequest. */ - class DisableProgramRequest implements IDisableProgramRequest { - - /** - * Constructs a new DisableProgramRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest); - - /** DisableProgramRequest name. */ - public name: string; - - /** - * Creates a new DisableProgramRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DisableProgramRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest): google.shopping.merchant.accounts.v1beta.DisableProgramRequest; - - /** - * Encodes the specified DisableProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DisableProgramRequest.verify|verify} messages. - * @param message DisableProgramRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisableProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DisableProgramRequest.verify|verify} messages. - * @param message DisableProgramRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisableProgramRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisableProgramRequest - * @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.DisableProgramRequest; - - /** - * Decodes a DisableProgramRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisableProgramRequest - * @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.DisableProgramRequest; - - /** - * Verifies a DisableProgramRequest 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 DisableProgramRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisableProgramRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DisableProgramRequest; - - /** - * Creates a plain object from a DisableProgramRequest message. Also converts values to other types if specified. - * @param message DisableProgramRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.DisableProgramRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisableProgramRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisableProgramRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a RegionsService */ - class RegionsService extends $protobuf.rpc.Service { - - /** - * Constructs a new RegionsService 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 RegionsService 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): RegionsService; - - /** - * Calls GetRegion. - * @param request GetRegionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Region - */ - public getRegion(request: google.shopping.merchant.accounts.v1beta.IGetRegionRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.GetRegionCallback): void; - - /** - * Calls GetRegion. - * @param request GetRegionRequest message or plain object - * @returns Promise - */ - public getRegion(request: google.shopping.merchant.accounts.v1beta.IGetRegionRequest): Promise; - - /** - * Calls CreateRegion. - * @param request CreateRegionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Region - */ - public createRegion(request: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.CreateRegionCallback): void; - - /** - * Calls CreateRegion. - * @param request CreateRegionRequest message or plain object - * @returns Promise - */ - public createRegion(request: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest): Promise; - - /** - * Calls UpdateRegion. - * @param request UpdateRegionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Region - */ - public updateRegion(request: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.UpdateRegionCallback): void; - - /** - * Calls UpdateRegion. - * @param request UpdateRegionRequest message or plain object - * @returns Promise - */ - public updateRegion(request: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest): Promise; - - /** - * Calls DeleteRegion. - * @param request DeleteRegionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteRegion(request: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.DeleteRegionCallback): void; - - /** - * Calls DeleteRegion. - * @param request DeleteRegionRequest message or plain object - * @returns Promise - */ - public deleteRegion(request: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest): Promise; - - /** - * Calls ListRegions. - * @param request ListRegionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListRegionsResponse - */ - public listRegions(request: google.shopping.merchant.accounts.v1beta.IListRegionsRequest, callback: google.shopping.merchant.accounts.v1beta.RegionsService.ListRegionsCallback): void; - - /** - * Calls ListRegions. - * @param request ListRegionsRequest message or plain object - * @returns Promise - */ - public listRegions(request: google.shopping.merchant.accounts.v1beta.IListRegionsRequest): Promise; - } - - namespace RegionsService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|getRegion}. - * @param error Error, if any - * @param [response] Region - */ - type GetRegionCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Region) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|createRegion}. - * @param error Error, if any - * @param [response] Region - */ - type CreateRegionCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Region) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|updateRegion}. - * @param error Error, if any - * @param [response] Region - */ - type UpdateRegionCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.Region) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|deleteRegion}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteRegionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|listRegions}. - * @param error Error, if any - * @param [response] ListRegionsResponse - */ - type ListRegionsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ListRegionsResponse) => void; - } - - /** Properties of a GetRegionRequest. */ - interface IGetRegionRequest { - - /** GetRegionRequest name */ - name?: (string|null); - } - - /** Represents a GetRegionRequest. */ - class GetRegionRequest implements IGetRegionRequest { - - /** - * Constructs a new GetRegionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetRegionRequest); - - /** GetRegionRequest name. */ - public name: string; - - /** - * Creates a new GetRegionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetRegionRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetRegionRequest): google.shopping.merchant.accounts.v1beta.GetRegionRequest; - - /** - * Encodes the specified GetRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetRegionRequest.verify|verify} messages. - * @param message GetRegionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetRegionRequest.verify|verify} messages. - * @param message GetRegionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetRegionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetRegionRequest - * @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.GetRegionRequest; - - /** - * Decodes a GetRegionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetRegionRequest - * @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.GetRegionRequest; - - /** - * Verifies a GetRegionRequest 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 GetRegionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetRegionRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetRegionRequest; - - /** - * Creates a plain object from a GetRegionRequest message. Also converts values to other types if specified. - * @param message GetRegionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetRegionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetRegionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetRegionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateRegionRequest. */ - interface ICreateRegionRequest { - - /** CreateRegionRequest parent */ - parent?: (string|null); - - /** CreateRegionRequest regionId */ - regionId?: (string|null); - - /** CreateRegionRequest region */ - region?: (google.shopping.merchant.accounts.v1beta.IRegion|null); - } - - /** Represents a CreateRegionRequest. */ - class CreateRegionRequest implements ICreateRegionRequest { - - /** - * Constructs a new CreateRegionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest); - - /** CreateRegionRequest parent. */ - public parent: string; - - /** CreateRegionRequest regionId. */ - public regionId: string; - - /** CreateRegionRequest region. */ - public region?: (google.shopping.merchant.accounts.v1beta.IRegion|null); - - /** - * Creates a new CreateRegionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateRegionRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest): google.shopping.merchant.accounts.v1beta.CreateRegionRequest; - - /** - * Encodes the specified CreateRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateRegionRequest.verify|verify} messages. - * @param message CreateRegionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateRegionRequest.verify|verify} messages. - * @param message CreateRegionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateRegionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateRegionRequest - * @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.CreateRegionRequest; - - /** - * Decodes a CreateRegionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateRegionRequest - * @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.CreateRegionRequest; - - /** - * Verifies a CreateRegionRequest 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 CreateRegionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateRegionRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CreateRegionRequest; - - /** - * Creates a plain object from a CreateRegionRequest message. Also converts values to other types if specified. - * @param message CreateRegionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.CreateRegionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateRegionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateRegionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateRegionRequest. */ - interface IUpdateRegionRequest { - - /** UpdateRegionRequest region */ - region?: (google.shopping.merchant.accounts.v1beta.IRegion|null); - - /** UpdateRegionRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateRegionRequest. */ - class UpdateRegionRequest implements IUpdateRegionRequest { - - /** - * Constructs a new UpdateRegionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest); - - /** UpdateRegionRequest region. */ - public region?: (google.shopping.merchant.accounts.v1beta.IRegion|null); - - /** UpdateRegionRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateRegionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateRegionRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest): google.shopping.merchant.accounts.v1beta.UpdateRegionRequest; - - /** - * Encodes the specified UpdateRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.verify|verify} messages. - * @param message UpdateRegionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.verify|verify} messages. - * @param message UpdateRegionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateRegionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateRegionRequest - * @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.UpdateRegionRequest; - - /** - * Decodes an UpdateRegionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateRegionRequest - * @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.UpdateRegionRequest; - - /** - * Verifies an UpdateRegionRequest 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 UpdateRegionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateRegionRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.UpdateRegionRequest; - - /** - * Creates a plain object from an UpdateRegionRequest message. Also converts values to other types if specified. - * @param message UpdateRegionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.UpdateRegionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateRegionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateRegionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteRegionRequest. */ - interface IDeleteRegionRequest { - - /** DeleteRegionRequest name */ - name?: (string|null); - } - - /** Represents a DeleteRegionRequest. */ - class DeleteRegionRequest implements IDeleteRegionRequest { - - /** - * Constructs a new DeleteRegionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest); - - /** DeleteRegionRequest name. */ - public name: string; - - /** - * Creates a new DeleteRegionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteRegionRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest): google.shopping.merchant.accounts.v1beta.DeleteRegionRequest; - - /** - * Encodes the specified DeleteRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteRegionRequest.verify|verify} messages. - * @param message DeleteRegionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteRegionRequest.verify|verify} messages. - * @param message DeleteRegionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteRegionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteRegionRequest - * @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.DeleteRegionRequest; - - /** - * Decodes a DeleteRegionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteRegionRequest - * @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.DeleteRegionRequest; - - /** - * Verifies a DeleteRegionRequest 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 DeleteRegionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteRegionRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DeleteRegionRequest; - - /** - * Creates a plain object from a DeleteRegionRequest message. Also converts values to other types if specified. - * @param message DeleteRegionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.DeleteRegionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteRegionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteRegionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRegionsRequest. */ - interface IListRegionsRequest { - - /** ListRegionsRequest parent */ - parent?: (string|null); - - /** ListRegionsRequest pageSize */ - pageSize?: (number|null); - - /** ListRegionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListRegionsRequest. */ - class ListRegionsRequest implements IListRegionsRequest { - - /** - * Constructs a new ListRegionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListRegionsRequest); - - /** ListRegionsRequest parent. */ - public parent: string; - - /** ListRegionsRequest pageSize. */ - public pageSize: number; - - /** ListRegionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListRegionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRegionsRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListRegionsRequest): google.shopping.merchant.accounts.v1beta.ListRegionsRequest; - - /** - * Encodes the specified ListRegionsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsRequest.verify|verify} messages. - * @param message ListRegionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListRegionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRegionsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsRequest.verify|verify} messages. - * @param message ListRegionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListRegionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRegionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRegionsRequest - * @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.ListRegionsRequest; - - /** - * Decodes a ListRegionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRegionsRequest - * @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.ListRegionsRequest; - - /** - * Verifies a ListRegionsRequest 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 ListRegionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRegionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListRegionsRequest; - - /** - * Creates a plain object from a ListRegionsRequest message. Also converts values to other types if specified. - * @param message ListRegionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListRegionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRegionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRegionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListRegionsResponse. */ - interface IListRegionsResponse { - - /** ListRegionsResponse regions */ - regions?: (google.shopping.merchant.accounts.v1beta.IRegion[]|null); - - /** ListRegionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListRegionsResponse. */ - class ListRegionsResponse implements IListRegionsResponse { - - /** - * Constructs a new ListRegionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IListRegionsResponse); - - /** ListRegionsResponse regions. */ - public regions: google.shopping.merchant.accounts.v1beta.IRegion[]; - - /** ListRegionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListRegionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListRegionsResponse instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IListRegionsResponse): google.shopping.merchant.accounts.v1beta.ListRegionsResponse; - - /** - * Encodes the specified ListRegionsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsResponse.verify|verify} messages. - * @param message ListRegionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IListRegionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListRegionsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsResponse.verify|verify} messages. - * @param message ListRegionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IListRegionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListRegionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListRegionsResponse - * @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.ListRegionsResponse; - - /** - * Decodes a ListRegionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListRegionsResponse - * @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.ListRegionsResponse; - - /** - * Verifies a ListRegionsResponse 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 ListRegionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListRegionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ListRegionsResponse; - - /** - * Creates a plain object from a ListRegionsResponse message. Also converts values to other types if specified. - * @param message ListRegionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ListRegionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListRegionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListRegionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Region. */ - interface IRegion { - - /** Region name */ - name?: (string|null); - - /** Region displayName */ - displayName?: (string|null); - - /** Region postalCodeArea */ - postalCodeArea?: (google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea|null); - - /** Region geotargetArea */ - geotargetArea?: (google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea|null); - - /** Region regionalInventoryEligible */ - regionalInventoryEligible?: (google.protobuf.IBoolValue|null); - - /** Region shippingEligible */ - shippingEligible?: (google.protobuf.IBoolValue|null); - } - - /** Represents a Region. */ - class Region implements IRegion { - - /** - * Constructs a new Region. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IRegion); - - /** Region name. */ - public name: string; - - /** Region displayName. */ - public displayName?: (string|null); - - /** Region postalCodeArea. */ - public postalCodeArea?: (google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea|null); - - /** Region geotargetArea. */ - public geotargetArea?: (google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea|null); - - /** Region regionalInventoryEligible. */ - public regionalInventoryEligible?: (google.protobuf.IBoolValue|null); - - /** Region shippingEligible. */ - public shippingEligible?: (google.protobuf.IBoolValue|null); - - /** Region _displayName. */ - public _displayName?: "displayName"; - - /** - * Creates a new Region instance using the specified properties. - * @param [properties] Properties to set - * @returns Region instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IRegion): google.shopping.merchant.accounts.v1beta.Region; - - /** - * Encodes the specified Region message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.verify|verify} messages. - * @param message Region message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IRegion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Region message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.verify|verify} messages. - * @param message Region message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRegion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Region message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Region - * @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.Region; - - /** - * Decodes a Region message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Region - * @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.Region; - - /** - * Verifies a Region 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 Region message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Region - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Region; - - /** - * Creates a plain object from a Region message. Also converts values to other types if specified. - * @param message Region - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Region, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Region to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Region - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Region { - - /** Properties of a PostalCodeArea. */ - interface IPostalCodeArea { - - /** PostalCodeArea regionCode */ - regionCode?: (string|null); - - /** PostalCodeArea postalCodes */ - postalCodes?: (google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange[]|null); - } - - /** Represents a PostalCodeArea. */ - class PostalCodeArea implements IPostalCodeArea { - - /** - * Constructs a new PostalCodeArea. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea); - - /** PostalCodeArea regionCode. */ - public regionCode: string; - - /** PostalCodeArea postalCodes. */ - public postalCodes: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange[]; - - /** - * Creates a new PostalCodeArea instance using the specified properties. - * @param [properties] Properties to set - * @returns PostalCodeArea instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea): google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea; - - /** - * Encodes the specified PostalCodeArea message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify|verify} messages. - * @param message PostalCodeArea message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PostalCodeArea message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify|verify} messages. - * @param message PostalCodeArea message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PostalCodeArea message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PostalCodeArea - * @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.Region.PostalCodeArea; - - /** - * Decodes a PostalCodeArea message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PostalCodeArea - * @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.Region.PostalCodeArea; - - /** - * Verifies a PostalCodeArea 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 PostalCodeArea message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PostalCodeArea - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea; - - /** - * Creates a plain object from a PostalCodeArea message. Also converts values to other types if specified. - * @param message PostalCodeArea - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PostalCodeArea to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PostalCodeArea - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PostalCodeArea { - - /** Properties of a PostalCodeRange. */ - interface IPostalCodeRange { - - /** PostalCodeRange begin */ - begin?: (string|null); - - /** PostalCodeRange end */ - end?: (string|null); - } - - /** Represents a PostalCodeRange. */ - class PostalCodeRange implements IPostalCodeRange { - - /** - * Constructs a new PostalCodeRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange); - - /** PostalCodeRange begin. */ - public begin: string; - - /** PostalCodeRange end. */ - public end: string; - - /** - * Creates a new PostalCodeRange instance using the specified properties. - * @param [properties] Properties to set - * @returns PostalCodeRange instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange): google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange; - - /** - * Encodes the specified PostalCodeRange message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify|verify} messages. - * @param message PostalCodeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PostalCodeRange message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify|verify} messages. - * @param message PostalCodeRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PostalCodeRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PostalCodeRange - * @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.Region.PostalCodeArea.PostalCodeRange; - - /** - * Decodes a PostalCodeRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PostalCodeRange - * @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.Region.PostalCodeArea.PostalCodeRange; - - /** - * Verifies a PostalCodeRange 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 PostalCodeRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PostalCodeRange - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange; - - /** - * Creates a plain object from a PostalCodeRange message. Also converts values to other types if specified. - * @param message PostalCodeRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PostalCodeRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PostalCodeRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeoTargetArea. */ - interface IGeoTargetArea { - - /** GeoTargetArea geotargetCriteriaIds */ - geotargetCriteriaIds?: ((number|Long|string)[]|null); - } - - /** Represents a GeoTargetArea. */ - class GeoTargetArea implements IGeoTargetArea { - - /** - * Constructs a new GeoTargetArea. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea); - - /** GeoTargetArea geotargetCriteriaIds. */ - public geotargetCriteriaIds: (number|Long|string)[]; - - /** - * Creates a new GeoTargetArea instance using the specified properties. - * @param [properties] Properties to set - * @returns GeoTargetArea instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea): google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea; - - /** - * Encodes the specified GeoTargetArea message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify|verify} messages. - * @param message GeoTargetArea message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeoTargetArea message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify|verify} messages. - * @param message GeoTargetArea message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeoTargetArea message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeoTargetArea - * @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.Region.GeoTargetArea; - - /** - * Decodes a GeoTargetArea message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeoTargetArea - * @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.Region.GeoTargetArea; - - /** - * Verifies a GeoTargetArea 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 GeoTargetArea message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeoTargetArea - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea; - - /** - * Creates a plain object from a GeoTargetArea message. Also converts values to other types if specified. - * @param message GeoTargetArea - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeoTargetArea to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeoTargetArea - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Represents a ShippingSettingsService */ - class ShippingSettingsService extends $protobuf.rpc.Service { - - /** - * Constructs a new ShippingSettingsService 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 ShippingSettingsService 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): ShippingSettingsService; - - /** - * Calls GetShippingSettings. - * @param request GetShippingSettingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ShippingSettings - */ - public getShippingSettings(request: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, callback: google.shopping.merchant.accounts.v1beta.ShippingSettingsService.GetShippingSettingsCallback): void; - - /** - * Calls GetShippingSettings. - * @param request GetShippingSettingsRequest message or plain object - * @returns Promise - */ - public getShippingSettings(request: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest): Promise; - - /** - * Calls InsertShippingSettings. - * @param request InsertShippingSettingsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ShippingSettings - */ - public insertShippingSettings(request: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, callback: google.shopping.merchant.accounts.v1beta.ShippingSettingsService.InsertShippingSettingsCallback): void; - - /** - * Calls InsertShippingSettings. - * @param request InsertShippingSettingsRequest message or plain object - * @returns Promise - */ - public insertShippingSettings(request: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest): Promise; - } - - namespace ShippingSettingsService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ShippingSettingsService|getShippingSettings}. - * @param error Error, if any - * @param [response] ShippingSettings - */ - type GetShippingSettingsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ShippingSettings) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ShippingSettingsService|insertShippingSettings}. - * @param error Error, if any - * @param [response] ShippingSettings - */ - type InsertShippingSettingsCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.ShippingSettings) => void; - } - - /** Properties of a ShippingSettings. */ - interface IShippingSettings { - - /** ShippingSettings name */ - name?: (string|null); - - /** ShippingSettings services */ - services?: (google.shopping.merchant.accounts.v1beta.IService[]|null); - - /** ShippingSettings warehouses */ - warehouses?: (google.shopping.merchant.accounts.v1beta.IWarehouse[]|null); - - /** ShippingSettings etag */ - etag?: (string|null); - } - - /** Represents a ShippingSettings. */ - class ShippingSettings implements IShippingSettings { - - /** - * Constructs a new ShippingSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IShippingSettings); - - /** ShippingSettings name. */ - public name: string; - - /** ShippingSettings services. */ - public services: google.shopping.merchant.accounts.v1beta.IService[]; - - /** ShippingSettings warehouses. */ - public warehouses: google.shopping.merchant.accounts.v1beta.IWarehouse[]; - - /** ShippingSettings etag. */ - public etag: string; - - /** - * Creates a new ShippingSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ShippingSettings instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IShippingSettings): google.shopping.merchant.accounts.v1beta.ShippingSettings; - - /** - * Encodes the specified ShippingSettings message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ShippingSettings.verify|verify} messages. - * @param message ShippingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IShippingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShippingSettings message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ShippingSettings.verify|verify} messages. - * @param message ShippingSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IShippingSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShippingSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShippingSettings - * @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.ShippingSettings; - - /** - * Decodes a ShippingSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShippingSettings - * @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.ShippingSettings; - - /** - * Verifies a ShippingSettings 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 ShippingSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShippingSettings - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.ShippingSettings; - - /** - * Creates a plain object from a ShippingSettings message. Also converts values to other types if specified. - * @param message ShippingSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.ShippingSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShippingSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShippingSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Service. */ - interface IService { - - /** Service serviceName */ - serviceName?: (string|null); - - /** Service active */ - active?: (boolean|null); - - /** Service deliveryCountries */ - deliveryCountries?: (string[]|null); - - /** Service currencyCode */ - currencyCode?: (string|null); - - /** Service deliveryTime */ - deliveryTime?: (google.shopping.merchant.accounts.v1beta.IDeliveryTime|null); - - /** Service rateGroups */ - rateGroups?: (google.shopping.merchant.accounts.v1beta.IRateGroup[]|null); - - /** Service shipmentType */ - shipmentType?: (google.shopping.merchant.accounts.v1beta.Service.ShipmentType|keyof typeof google.shopping.merchant.accounts.v1beta.Service.ShipmentType|null); - - /** Service minimumOrderValue */ - minimumOrderValue?: (google.shopping.type.IPrice|null); - - /** Service minimumOrderValueTable */ - minimumOrderValueTable?: (google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable|null); - - /** Service storeConfig */ - storeConfig?: (google.shopping.merchant.accounts.v1beta.Service.IStoreConfig|null); - - /** Service loyaltyPrograms */ - loyaltyPrograms?: (google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram[]|null); - } - - /** Represents a Service. */ - class Service implements IService { - - /** - * Constructs a new Service. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IService); - - /** Service serviceName. */ - public serviceName?: (string|null); - - /** Service active. */ - public active?: (boolean|null); - - /** Service deliveryCountries. */ - public deliveryCountries: string[]; - - /** Service currencyCode. */ - public currencyCode?: (string|null); - - /** Service deliveryTime. */ - public deliveryTime?: (google.shopping.merchant.accounts.v1beta.IDeliveryTime|null); - - /** Service rateGroups. */ - public rateGroups: google.shopping.merchant.accounts.v1beta.IRateGroup[]; - - /** Service shipmentType. */ - public shipmentType?: (google.shopping.merchant.accounts.v1beta.Service.ShipmentType|keyof typeof google.shopping.merchant.accounts.v1beta.Service.ShipmentType|null); - - /** Service minimumOrderValue. */ - public minimumOrderValue?: (google.shopping.type.IPrice|null); - - /** Service minimumOrderValueTable. */ - public minimumOrderValueTable?: (google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable|null); - - /** Service storeConfig. */ - public storeConfig?: (google.shopping.merchant.accounts.v1beta.Service.IStoreConfig|null); - - /** Service loyaltyPrograms. */ - public loyaltyPrograms: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram[]; - - /** Service _serviceName. */ - public _serviceName?: "serviceName"; - - /** Service _active. */ - public _active?: "active"; - - /** Service _currencyCode. */ - public _currencyCode?: "currencyCode"; - - /** Service _deliveryTime. */ - public _deliveryTime?: "deliveryTime"; - - /** Service _shipmentType. */ - public _shipmentType?: "shipmentType"; - - /** Service _minimumOrderValue. */ - public _minimumOrderValue?: "minimumOrderValue"; - - /** Service _minimumOrderValueTable. */ - public _minimumOrderValueTable?: "minimumOrderValueTable"; - - /** Service _storeConfig. */ - public _storeConfig?: "storeConfig"; - - /** - * Creates a new Service instance using the specified properties. - * @param [properties] Properties to set - * @returns Service instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IService): google.shopping.merchant.accounts.v1beta.Service; - - /** - * Encodes the specified Service message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.verify|verify} messages. - * @param message Service message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Service message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.verify|verify} messages. - * @param message Service message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Service message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Service - * @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.Service; - - /** - * Decodes a Service message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Service - * @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.Service; - - /** - * Verifies a Service 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 Service message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Service - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service; - - /** - * Creates a plain object from a Service message. Also converts values to other types if specified. - * @param message Service - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Service, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Service to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Service - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Service { - - /** Properties of a StoreConfig. */ - interface IStoreConfig { - - /** StoreConfig storeServiceType */ - storeServiceType?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|keyof typeof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|null); - - /** StoreConfig storeCodes */ - storeCodes?: (string[]|null); - - /** StoreConfig cutoffConfig */ - cutoffConfig?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig|null); - - /** StoreConfig serviceRadius */ - serviceRadius?: (google.shopping.merchant.accounts.v1beta.IDistance|null); - } - - /** Represents a StoreConfig. */ - class StoreConfig implements IStoreConfig { - - /** - * Constructs a new StoreConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.IStoreConfig); - - /** StoreConfig storeServiceType. */ - public storeServiceType?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|keyof typeof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|null); - - /** StoreConfig storeCodes. */ - public storeCodes: string[]; - - /** StoreConfig cutoffConfig. */ - public cutoffConfig?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig|null); - - /** StoreConfig serviceRadius. */ - public serviceRadius?: (google.shopping.merchant.accounts.v1beta.IDistance|null); - - /** StoreConfig _storeServiceType. */ - public _storeServiceType?: "storeServiceType"; - - /** StoreConfig _cutoffConfig. */ - public _cutoffConfig?: "cutoffConfig"; - - /** StoreConfig _serviceRadius. */ - public _serviceRadius?: "serviceRadius"; - - /** - * Creates a new StoreConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns StoreConfig instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.IStoreConfig): google.shopping.merchant.accounts.v1beta.Service.StoreConfig; - - /** - * Encodes the specified StoreConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify|verify} messages. - * @param message StoreConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.Service.IStoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StoreConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify|verify} messages. - * @param message StoreConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.IStoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StoreConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StoreConfig - * @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.Service.StoreConfig; - - /** - * Decodes a StoreConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StoreConfig - * @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.Service.StoreConfig; - - /** - * Verifies a StoreConfig 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 StoreConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StoreConfig - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.StoreConfig; - - /** - * Creates a plain object from a StoreConfig message. Also converts values to other types if specified. - * @param message StoreConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StoreConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StoreConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace StoreConfig { - - /** Properties of a CutoffConfig. */ - interface ICutoffConfig { - - /** CutoffConfig localCutoffTime */ - localCutoffTime?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime|null); - - /** CutoffConfig storeCloseOffsetHours */ - storeCloseOffsetHours?: (number|Long|string|null); - - /** CutoffConfig noDeliveryPostCutoff */ - noDeliveryPostCutoff?: (boolean|null); - } - - /** Represents a CutoffConfig. */ - class CutoffConfig implements ICutoffConfig { - - /** - * Constructs a new CutoffConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig); - - /** CutoffConfig localCutoffTime. */ - public localCutoffTime?: (google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime|null); - - /** CutoffConfig storeCloseOffsetHours. */ - public storeCloseOffsetHours?: (number|Long|string|null); - - /** CutoffConfig noDeliveryPostCutoff. */ - public noDeliveryPostCutoff?: (boolean|null); - - /** CutoffConfig _localCutoffTime. */ - public _localCutoffTime?: "localCutoffTime"; - - /** CutoffConfig _storeCloseOffsetHours. */ - public _storeCloseOffsetHours?: "storeCloseOffsetHours"; - - /** CutoffConfig _noDeliveryPostCutoff. */ - public _noDeliveryPostCutoff?: "noDeliveryPostCutoff"; - - /** - * Creates a new CutoffConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CutoffConfig instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig): google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig; - - /** - * Encodes the specified CutoffConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify|verify} messages. - * @param message CutoffConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CutoffConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify|verify} messages. - * @param message CutoffConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CutoffConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CutoffConfig - * @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.Service.StoreConfig.CutoffConfig; - - /** - * Decodes a CutoffConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CutoffConfig - * @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.Service.StoreConfig.CutoffConfig; - - /** - * Verifies a CutoffConfig 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 CutoffConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CutoffConfig - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig; - - /** - * Creates a plain object from a CutoffConfig message. Also converts values to other types if specified. - * @param message CutoffConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CutoffConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CutoffConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CutoffConfig { - - /** Properties of a LocalCutoffTime. */ - interface ILocalCutoffTime { - - /** LocalCutoffTime hour */ - hour?: (number|Long|string|null); - - /** LocalCutoffTime minute */ - minute?: (number|Long|string|null); - } - - /** Represents a LocalCutoffTime. */ - class LocalCutoffTime implements ILocalCutoffTime { - - /** - * Constructs a new LocalCutoffTime. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime); - - /** LocalCutoffTime hour. */ - public hour?: (number|Long|string|null); - - /** LocalCutoffTime minute. */ - public minute?: (number|Long|string|null); - - /** LocalCutoffTime _hour. */ - public _hour?: "hour"; - - /** LocalCutoffTime _minute. */ - public _minute?: "minute"; - - /** - * Creates a new LocalCutoffTime instance using the specified properties. - * @param [properties] Properties to set - * @returns LocalCutoffTime instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime): google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime; - - /** - * Encodes the specified LocalCutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify|verify} messages. - * @param message LocalCutoffTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocalCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify|verify} messages. - * @param message LocalCutoffTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocalCutoffTime message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocalCutoffTime - * @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.Service.StoreConfig.CutoffConfig.LocalCutoffTime; - - /** - * Decodes a LocalCutoffTime message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocalCutoffTime - * @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.Service.StoreConfig.CutoffConfig.LocalCutoffTime; - - /** - * Verifies a LocalCutoffTime 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 LocalCutoffTime message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocalCutoffTime - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime; - - /** - * Creates a plain object from a LocalCutoffTime message. Also converts values to other types if specified. - * @param message LocalCutoffTime - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocalCutoffTime to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocalCutoffTime - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** StoreServiceType enum. */ - enum StoreServiceType { - STORE_SERVICE_TYPE_UNSPECIFIED = 0, - ALL_STORES = 1, - SELECTED_STORES = 2 - } - } - - /** Properties of a LoyaltyProgram. */ - interface ILoyaltyProgram { - - /** LoyaltyProgram programLabel */ - programLabel?: (string|null); - - /** LoyaltyProgram loyaltyProgramTiers */ - loyaltyProgramTiers?: (google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers[]|null); - } - - /** Represents a LoyaltyProgram. */ - class LoyaltyProgram implements ILoyaltyProgram { - - /** - * Constructs a new LoyaltyProgram. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram); - - /** LoyaltyProgram programLabel. */ - public programLabel?: (string|null); - - /** LoyaltyProgram loyaltyProgramTiers. */ - public loyaltyProgramTiers: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers[]; - - /** LoyaltyProgram _programLabel. */ - public _programLabel?: "programLabel"; - - /** - * Creates a new LoyaltyProgram instance using the specified properties. - * @param [properties] Properties to set - * @returns LoyaltyProgram instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram): google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram; - - /** - * Encodes the specified LoyaltyProgram message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify|verify} messages. - * @param message LoyaltyProgram message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LoyaltyProgram message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify|verify} messages. - * @param message LoyaltyProgram message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LoyaltyProgram message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LoyaltyProgram - * @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.Service.LoyaltyProgram; - - /** - * Decodes a LoyaltyProgram message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LoyaltyProgram - * @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.Service.LoyaltyProgram; - - /** - * Verifies a LoyaltyProgram 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 LoyaltyProgram message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LoyaltyProgram - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram; - - /** - * Creates a plain object from a LoyaltyProgram message. Also converts values to other types if specified. - * @param message LoyaltyProgram - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LoyaltyProgram to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LoyaltyProgram - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LoyaltyProgram { - - /** Properties of a LoyaltyProgramTiers. */ - interface ILoyaltyProgramTiers { - - /** LoyaltyProgramTiers tierLabel */ - tierLabel?: (string|null); - } - - /** Represents a LoyaltyProgramTiers. */ - class LoyaltyProgramTiers implements ILoyaltyProgramTiers { - - /** - * Constructs a new LoyaltyProgramTiers. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers); - - /** LoyaltyProgramTiers tierLabel. */ - public tierLabel?: (string|null); - - /** LoyaltyProgramTiers _tierLabel. */ - public _tierLabel?: "tierLabel"; - - /** - * Creates a new LoyaltyProgramTiers instance using the specified properties. - * @param [properties] Properties to set - * @returns LoyaltyProgramTiers instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers): google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers; - - /** - * Encodes the specified LoyaltyProgramTiers message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify|verify} messages. - * @param message LoyaltyProgramTiers message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LoyaltyProgramTiers message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify|verify} messages. - * @param message LoyaltyProgramTiers message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LoyaltyProgramTiers message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LoyaltyProgramTiers - * @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.Service.LoyaltyProgram.LoyaltyProgramTiers; - - /** - * Decodes a LoyaltyProgramTiers message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LoyaltyProgramTiers - * @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.Service.LoyaltyProgram.LoyaltyProgramTiers; - - /** - * Verifies a LoyaltyProgramTiers 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 LoyaltyProgramTiers message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LoyaltyProgramTiers - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers; - - /** - * Creates a plain object from a LoyaltyProgramTiers message. Also converts values to other types if specified. - * @param message LoyaltyProgramTiers - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LoyaltyProgramTiers to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LoyaltyProgramTiers - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ShipmentType enum. */ - enum ShipmentType { - SHIPMENT_TYPE_UNSPECIFIED = 0, - DELIVERY = 1, - LOCAL_DELIVERY = 2, - COLLECTION_POINT = 3 - } - } - - /** Properties of a Distance. */ - interface IDistance { - - /** Distance value */ - value?: (number|Long|string|null); - - /** Distance unit */ - unit?: (google.shopping.merchant.accounts.v1beta.Distance.Unit|keyof typeof google.shopping.merchant.accounts.v1beta.Distance.Unit|null); - } - - /** Represents a Distance. */ - class Distance implements IDistance { - - /** - * Constructs a new Distance. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IDistance); - - /** Distance value. */ - public value?: (number|Long|string|null); - - /** Distance unit. */ - public unit?: (google.shopping.merchant.accounts.v1beta.Distance.Unit|keyof typeof google.shopping.merchant.accounts.v1beta.Distance.Unit|null); - - /** Distance _value. */ - public _value?: "value"; - - /** Distance _unit. */ - public _unit?: "unit"; - - /** - * Creates a new Distance instance using the specified properties. - * @param [properties] Properties to set - * @returns Distance instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IDistance): google.shopping.merchant.accounts.v1beta.Distance; - - /** - * Encodes the specified Distance message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Distance.verify|verify} messages. - * @param message Distance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IDistance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Distance message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Distance.verify|verify} messages. - * @param message Distance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDistance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Distance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Distance - * @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.Distance; - - /** - * Decodes a Distance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Distance - * @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.Distance; - - /** - * Verifies a Distance 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 Distance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Distance - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Distance; - - /** - * Creates a plain object from a Distance message. Also converts values to other types if specified. - * @param message Distance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Distance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Distance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Distance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Distance { - - /** Unit enum. */ - enum Unit { - UNIT_UNSPECIFIED = 0, - MILES = 1, - KILOMETERS = 2 - } - } - - /** Properties of a Warehouse. */ - interface IWarehouse { - - /** Warehouse name */ - name?: (string|null); - - /** Warehouse shippingAddress */ - shippingAddress?: (google.shopping.merchant.accounts.v1beta.IAddress|null); - - /** Warehouse cutoffTime */ - cutoffTime?: (google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime|null); - - /** Warehouse handlingDays */ - handlingDays?: (number|Long|string|null); - - /** Warehouse businessDayConfig */ - businessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); - } - - /** Represents a Warehouse. */ - class Warehouse implements IWarehouse { - - /** - * Constructs a new Warehouse. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IWarehouse); - - /** Warehouse name. */ - public name?: (string|null); - - /** Warehouse shippingAddress. */ - public shippingAddress?: (google.shopping.merchant.accounts.v1beta.IAddress|null); - - /** Warehouse cutoffTime. */ - public cutoffTime?: (google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime|null); - - /** Warehouse handlingDays. */ - public handlingDays?: (number|Long|string|null); - - /** Warehouse businessDayConfig. */ - public businessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); - - /** Warehouse _name. */ - public _name?: "name"; - - /** Warehouse _shippingAddress. */ - public _shippingAddress?: "shippingAddress"; - - /** Warehouse _cutoffTime. */ - public _cutoffTime?: "cutoffTime"; - - /** Warehouse _handlingDays. */ - public _handlingDays?: "handlingDays"; - - /** Warehouse _businessDayConfig. */ - public _businessDayConfig?: "businessDayConfig"; - - /** - * Creates a new Warehouse instance using the specified properties. - * @param [properties] Properties to set - * @returns Warehouse instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IWarehouse): google.shopping.merchant.accounts.v1beta.Warehouse; - - /** - * Encodes the specified Warehouse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Warehouse.verify|verify} messages. - * @param message Warehouse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IWarehouse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Warehouse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Warehouse.verify|verify} messages. - * @param message Warehouse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IWarehouse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Warehouse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Warehouse - * @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.Warehouse; - - /** - * Decodes a Warehouse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Warehouse - * @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.Warehouse; - - /** - * Verifies a Warehouse 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 Warehouse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Warehouse - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Warehouse; - - /** - * Creates a plain object from a Warehouse message. Also converts values to other types if specified. - * @param message Warehouse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Warehouse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Warehouse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Warehouse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WarehouseCutoffTime. */ - interface IWarehouseCutoffTime { - - /** WarehouseCutoffTime hour */ - hour?: (number|null); - - /** WarehouseCutoffTime minute */ - minute?: (number|null); - } - - /** Represents a WarehouseCutoffTime. */ - class WarehouseCutoffTime implements IWarehouseCutoffTime { - - /** - * Constructs a new WarehouseCutoffTime. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime); - - /** WarehouseCutoffTime hour. */ - public hour?: (number|null); - - /** WarehouseCutoffTime minute. */ - public minute?: (number|null); - - /** WarehouseCutoffTime _hour. */ - public _hour?: "hour"; - - /** WarehouseCutoffTime _minute. */ - public _minute?: "minute"; - - /** - * Creates a new WarehouseCutoffTime instance using the specified properties. - * @param [properties] Properties to set - * @returns WarehouseCutoffTime instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime): google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime; - - /** - * Encodes the specified WarehouseCutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify|verify} messages. - * @param message WarehouseCutoffTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WarehouseCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify|verify} messages. - * @param message WarehouseCutoffTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WarehouseCutoffTime message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WarehouseCutoffTime - * @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.WarehouseCutoffTime; - - /** - * Decodes a WarehouseCutoffTime message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WarehouseCutoffTime - * @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.WarehouseCutoffTime; - - /** - * Verifies a WarehouseCutoffTime 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 WarehouseCutoffTime message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WarehouseCutoffTime - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime; - - /** - * Creates a plain object from a WarehouseCutoffTime message. Also converts values to other types if specified. - * @param message WarehouseCutoffTime - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WarehouseCutoffTime to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WarehouseCutoffTime - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Address. */ - interface IAddress { - - /** Address streetAddress */ - streetAddress?: (string|null); - - /** Address city */ - city?: (string|null); - - /** Address administrativeArea */ - administrativeArea?: (string|null); - - /** Address postalCode */ - postalCode?: (string|null); - - /** Address regionCode */ - regionCode?: (string|null); - } - - /** Represents an Address. */ - class Address implements IAddress { - - /** - * Constructs a new Address. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IAddress); - - /** Address streetAddress. */ - public streetAddress?: (string|null); - - /** Address city. */ - public city?: (string|null); - - /** Address administrativeArea. */ - public administrativeArea?: (string|null); - - /** Address postalCode. */ - public postalCode?: (string|null); - - /** Address regionCode. */ - public regionCode?: (string|null); - - /** Address _streetAddress. */ - public _streetAddress?: "streetAddress"; - - /** Address _city. */ - public _city?: "city"; - - /** Address _administrativeArea. */ - public _administrativeArea?: "administrativeArea"; - - /** Address _postalCode. */ - public _postalCode?: "postalCode"; - - /** Address _regionCode. */ - public _regionCode?: "regionCode"; - - /** - * Creates a new Address instance using the specified properties. - * @param [properties] Properties to set - * @returns Address instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IAddress): google.shopping.merchant.accounts.v1beta.Address; - - /** - * Encodes the specified Address message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Address.verify|verify} messages. - * @param message Address message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Address message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Address.verify|verify} messages. - * @param message Address message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Address message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Address - * @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.Address; - - /** - * Decodes an Address message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Address - * @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.Address; - - /** - * Verifies an Address 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 Address message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Address - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Address; - - /** - * Creates a plain object from an Address message. Also converts values to other types if specified. - * @param message Address - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Address, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Address to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Address - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeliveryTime. */ - interface IDeliveryTime { - - /** DeliveryTime minTransitDays */ - minTransitDays?: (number|null); - - /** DeliveryTime maxTransitDays */ - maxTransitDays?: (number|null); - - /** DeliveryTime cutoffTime */ - cutoffTime?: (google.shopping.merchant.accounts.v1beta.ICutoffTime|null); - - /** DeliveryTime minHandlingDays */ - minHandlingDays?: (number|null); - - /** DeliveryTime maxHandlingDays */ - maxHandlingDays?: (number|null); - - /** DeliveryTime transitTimeTable */ - transitTimeTable?: (google.shopping.merchant.accounts.v1beta.ITransitTable|null); - - /** DeliveryTime handlingBusinessDayConfig */ - handlingBusinessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); - - /** DeliveryTime transitBusinessDayConfig */ - transitBusinessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); - - /** DeliveryTime warehouseBasedDeliveryTimes */ - warehouseBasedDeliveryTimes?: (google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime[]|null); - } - - /** Represents a DeliveryTime. */ - class DeliveryTime implements IDeliveryTime { - - /** - * Constructs a new DeliveryTime. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IDeliveryTime); - - /** DeliveryTime minTransitDays. */ - public minTransitDays?: (number|null); - - /** DeliveryTime maxTransitDays. */ - public maxTransitDays?: (number|null); - - /** DeliveryTime cutoffTime. */ - public cutoffTime?: (google.shopping.merchant.accounts.v1beta.ICutoffTime|null); - - /** DeliveryTime minHandlingDays. */ - public minHandlingDays?: (number|null); - - /** DeliveryTime maxHandlingDays. */ - public maxHandlingDays?: (number|null); - - /** DeliveryTime transitTimeTable. */ - public transitTimeTable?: (google.shopping.merchant.accounts.v1beta.ITransitTable|null); - - /** DeliveryTime handlingBusinessDayConfig. */ - public handlingBusinessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); - - /** DeliveryTime transitBusinessDayConfig. */ - public transitBusinessDayConfig?: (google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null); - - /** DeliveryTime warehouseBasedDeliveryTimes. */ - public warehouseBasedDeliveryTimes: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime[]; - - /** DeliveryTime _minTransitDays. */ - public _minTransitDays?: "minTransitDays"; - - /** DeliveryTime _maxTransitDays. */ - public _maxTransitDays?: "maxTransitDays"; - - /** DeliveryTime _cutoffTime. */ - public _cutoffTime?: "cutoffTime"; - - /** DeliveryTime _minHandlingDays. */ - public _minHandlingDays?: "minHandlingDays"; - - /** DeliveryTime _maxHandlingDays. */ - public _maxHandlingDays?: "maxHandlingDays"; - - /** DeliveryTime _transitTimeTable. */ - public _transitTimeTable?: "transitTimeTable"; - - /** DeliveryTime _handlingBusinessDayConfig. */ - public _handlingBusinessDayConfig?: "handlingBusinessDayConfig"; - - /** DeliveryTime _transitBusinessDayConfig. */ - public _transitBusinessDayConfig?: "transitBusinessDayConfig"; - - /** - * Creates a new DeliveryTime instance using the specified properties. - * @param [properties] Properties to set - * @returns DeliveryTime instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IDeliveryTime): google.shopping.merchant.accounts.v1beta.DeliveryTime; - - /** - * Encodes the specified DeliveryTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeliveryTime.verify|verify} messages. - * @param message DeliveryTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IDeliveryTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeliveryTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeliveryTime.verify|verify} messages. - * @param message DeliveryTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IDeliveryTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeliveryTime message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeliveryTime - * @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.DeliveryTime; - - /** - * Decodes a DeliveryTime message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeliveryTime - * @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.DeliveryTime; - - /** - * Verifies a DeliveryTime 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 DeliveryTime message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeliveryTime - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.DeliveryTime; - - /** - * Creates a plain object from a DeliveryTime message. Also converts values to other types if specified. - * @param message DeliveryTime - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.DeliveryTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeliveryTime to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeliveryTime - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CutoffTime. */ - interface ICutoffTime { - - /** CutoffTime hour */ - hour?: (number|null); - - /** CutoffTime minute */ - minute?: (number|null); - - /** CutoffTime timeZone */ - timeZone?: (string|null); - } - - /** Represents a CutoffTime. */ - class CutoffTime implements ICutoffTime { - - /** - * Constructs a new CutoffTime. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ICutoffTime); - - /** CutoffTime hour. */ - public hour?: (number|null); - - /** CutoffTime minute. */ - public minute?: (number|null); - - /** CutoffTime timeZone. */ - public timeZone?: (string|null); - - /** CutoffTime _hour. */ - public _hour?: "hour"; - - /** CutoffTime _minute. */ - public _minute?: "minute"; - - /** CutoffTime _timeZone. */ - public _timeZone?: "timeZone"; - - /** - * Creates a new CutoffTime instance using the specified properties. - * @param [properties] Properties to set - * @returns CutoffTime instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ICutoffTime): google.shopping.merchant.accounts.v1beta.CutoffTime; - - /** - * Encodes the specified CutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CutoffTime.verify|verify} messages. - * @param message CutoffTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ICutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CutoffTime.verify|verify} messages. - * @param message CutoffTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICutoffTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CutoffTime message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CutoffTime - * @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.CutoffTime; - - /** - * Decodes a CutoffTime message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CutoffTime - * @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.CutoffTime; - - /** - * Verifies a CutoffTime 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 CutoffTime message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CutoffTime - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CutoffTime; - - /** - * Creates a plain object from a CutoffTime message. Also converts values to other types if specified. - * @param message CutoffTime - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.CutoffTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CutoffTime to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CutoffTime - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BusinessDayConfig. */ - interface IBusinessDayConfig { - - /** BusinessDayConfig businessDays */ - businessDays?: (google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday[]|null); - } - - /** Represents a BusinessDayConfig. */ - class BusinessDayConfig implements IBusinessDayConfig { - - /** - * Constructs a new BusinessDayConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IBusinessDayConfig); - - /** BusinessDayConfig businessDays. */ - public businessDays: google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday[]; - - /** - * Creates a new BusinessDayConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BusinessDayConfig instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IBusinessDayConfig): google.shopping.merchant.accounts.v1beta.BusinessDayConfig; - - /** - * Encodes the specified BusinessDayConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify|verify} messages. - * @param message BusinessDayConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IBusinessDayConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BusinessDayConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify|verify} messages. - * @param message BusinessDayConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IBusinessDayConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BusinessDayConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BusinessDayConfig - * @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.BusinessDayConfig; - - /** - * Decodes a BusinessDayConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BusinessDayConfig - * @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.BusinessDayConfig; - - /** - * Verifies a BusinessDayConfig 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 BusinessDayConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BusinessDayConfig - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.BusinessDayConfig; - - /** - * Creates a plain object from a BusinessDayConfig message. Also converts values to other types if specified. - * @param message BusinessDayConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.BusinessDayConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BusinessDayConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BusinessDayConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BusinessDayConfig { - - /** Weekday enum. */ - enum Weekday { - WEEKDAY_UNSPECIFIED = 0, - MONDAY = 1, - TUESDAY = 2, - WEDNESDAY = 3, - THURSDAY = 4, - FRIDAY = 5, - SATURDAY = 6, - SUNDAY = 7 - } - } - - /** Properties of a WarehouseBasedDeliveryTime. */ - interface IWarehouseBasedDeliveryTime { - - /** WarehouseBasedDeliveryTime carrier */ - carrier?: (string|null); - - /** WarehouseBasedDeliveryTime carrierService */ - carrierService?: (string|null); - - /** WarehouseBasedDeliveryTime warehouse */ - warehouse?: (string|null); - } - - /** Represents a WarehouseBasedDeliveryTime. */ - class WarehouseBasedDeliveryTime implements IWarehouseBasedDeliveryTime { - - /** - * Constructs a new WarehouseBasedDeliveryTime. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime); - - /** WarehouseBasedDeliveryTime carrier. */ - public carrier?: (string|null); - - /** WarehouseBasedDeliveryTime carrierService. */ - public carrierService?: (string|null); - - /** WarehouseBasedDeliveryTime warehouse. */ - public warehouse?: (string|null); - - /** WarehouseBasedDeliveryTime _carrier. */ - public _carrier?: "carrier"; - - /** WarehouseBasedDeliveryTime _carrierService. */ - public _carrierService?: "carrierService"; - - /** WarehouseBasedDeliveryTime _warehouse. */ - public _warehouse?: "warehouse"; - - /** - * Creates a new WarehouseBasedDeliveryTime instance using the specified properties. - * @param [properties] Properties to set - * @returns WarehouseBasedDeliveryTime instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime): google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime; - - /** - * Encodes the specified WarehouseBasedDeliveryTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify|verify} messages. - * @param message WarehouseBasedDeliveryTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WarehouseBasedDeliveryTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify|verify} messages. - * @param message WarehouseBasedDeliveryTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WarehouseBasedDeliveryTime message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WarehouseBasedDeliveryTime - * @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.WarehouseBasedDeliveryTime; - - /** - * Decodes a WarehouseBasedDeliveryTime message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WarehouseBasedDeliveryTime - * @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.WarehouseBasedDeliveryTime; - - /** - * Verifies a WarehouseBasedDeliveryTime 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 WarehouseBasedDeliveryTime message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WarehouseBasedDeliveryTime - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime; - - /** - * Creates a plain object from a WarehouseBasedDeliveryTime message. Also converts values to other types if specified. - * @param message WarehouseBasedDeliveryTime - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WarehouseBasedDeliveryTime to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WarehouseBasedDeliveryTime - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RateGroup. */ - interface IRateGroup { - - /** RateGroup applicableShippingLabels */ - applicableShippingLabels?: (string[]|null); - - /** RateGroup singleValue */ - singleValue?: (google.shopping.merchant.accounts.v1beta.IValue|null); - - /** RateGroup mainTable */ - mainTable?: (google.shopping.merchant.accounts.v1beta.ITable|null); - - /** RateGroup subtables */ - subtables?: (google.shopping.merchant.accounts.v1beta.ITable[]|null); - - /** RateGroup carrierRates */ - carrierRates?: (google.shopping.merchant.accounts.v1beta.ICarrierRate[]|null); - - /** RateGroup name */ - name?: (string|null); - } - - /** Represents a RateGroup. */ - class RateGroup implements IRateGroup { - - /** - * Constructs a new RateGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IRateGroup); - - /** RateGroup applicableShippingLabels. */ - public applicableShippingLabels: string[]; - - /** RateGroup singleValue. */ - public singleValue?: (google.shopping.merchant.accounts.v1beta.IValue|null); - - /** RateGroup mainTable. */ - public mainTable?: (google.shopping.merchant.accounts.v1beta.ITable|null); - - /** RateGroup subtables. */ - public subtables: google.shopping.merchant.accounts.v1beta.ITable[]; - - /** RateGroup carrierRates. */ - public carrierRates: google.shopping.merchant.accounts.v1beta.ICarrierRate[]; - - /** RateGroup name. */ - public name?: (string|null); - - /** RateGroup _singleValue. */ - public _singleValue?: "singleValue"; - - /** RateGroup _mainTable. */ - public _mainTable?: "mainTable"; - - /** RateGroup _name. */ - public _name?: "name"; - - /** - * Creates a new RateGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns RateGroup instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IRateGroup): google.shopping.merchant.accounts.v1beta.RateGroup; - - /** - * Encodes the specified RateGroup message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RateGroup.verify|verify} messages. - * @param message RateGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IRateGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RateGroup message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RateGroup.verify|verify} messages. - * @param message RateGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRateGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RateGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RateGroup - * @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.RateGroup; - - /** - * Decodes a RateGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RateGroup - * @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.RateGroup; - - /** - * Verifies a RateGroup 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 RateGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RateGroup - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.RateGroup; - - /** - * Creates a plain object from a RateGroup message. Also converts values to other types if specified. - * @param message RateGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.RateGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RateGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RateGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Table. */ - interface ITable { - - /** Table name */ - name?: (string|null); - - /** Table rowHeaders */ - rowHeaders?: (google.shopping.merchant.accounts.v1beta.IHeaders|null); - - /** Table columnHeaders */ - columnHeaders?: (google.shopping.merchant.accounts.v1beta.IHeaders|null); - - /** Table rows */ - rows?: (google.shopping.merchant.accounts.v1beta.IRow[]|null); - } - - /** Represents a Table. */ - class Table implements ITable { - - /** - * Constructs a new Table. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ITable); - - /** Table name. */ - public name?: (string|null); - - /** Table rowHeaders. */ - public rowHeaders?: (google.shopping.merchant.accounts.v1beta.IHeaders|null); - - /** Table columnHeaders. */ - public columnHeaders?: (google.shopping.merchant.accounts.v1beta.IHeaders|null); - - /** Table rows. */ - public rows: google.shopping.merchant.accounts.v1beta.IRow[]; - - /** Table _name. */ - public _name?: "name"; - - /** Table _rowHeaders. */ - public _rowHeaders?: "rowHeaders"; - - /** Table _columnHeaders. */ - public _columnHeaders?: "columnHeaders"; - - /** - * Creates a new Table instance using the specified properties. - * @param [properties] Properties to set - * @returns Table instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ITable): google.shopping.merchant.accounts.v1beta.Table; - - /** - * Encodes the specified Table message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Table.verify|verify} messages. - * @param message Table message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ITable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Table message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Table.verify|verify} messages. - * @param message Table message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Table message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Table - * @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.Table; - - /** - * Decodes a Table message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Table - * @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.Table; - - /** - * Verifies a Table 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 Table message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Table - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Table; - - /** - * Creates a plain object from a Table message. Also converts values to other types if specified. - * @param message Table - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Table, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Table to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Table - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TransitTable. */ - interface ITransitTable { - - /** TransitTable postalCodeGroupNames */ - postalCodeGroupNames?: (string[]|null); - - /** TransitTable transitTimeLabels */ - transitTimeLabels?: (string[]|null); - - /** TransitTable rows */ - rows?: (google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow[]|null); - } - - /** Represents a TransitTable. */ - class TransitTable implements ITransitTable { - - /** - * Constructs a new TransitTable. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ITransitTable); - - /** TransitTable postalCodeGroupNames. */ - public postalCodeGroupNames: string[]; - - /** TransitTable transitTimeLabels. */ - public transitTimeLabels: string[]; - - /** TransitTable rows. */ - public rows: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow[]; - - /** - * Creates a new TransitTable instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitTable instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ITransitTable): google.shopping.merchant.accounts.v1beta.TransitTable; - - /** - * Encodes the specified TransitTable message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.verify|verify} messages. - * @param message TransitTable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ITransitTable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitTable message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.verify|verify} messages. - * @param message TransitTable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITransitTable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitTable message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitTable - * @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.TransitTable; - - /** - * Decodes a TransitTable message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitTable - * @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.TransitTable; - - /** - * Verifies a TransitTable 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 TransitTable message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitTable - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TransitTable; - - /** - * Creates a plain object from a TransitTable message. Also converts values to other types if specified. - * @param message TransitTable - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.TransitTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitTable to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitTable - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TransitTable { - - /** Properties of a TransitTimeRow. */ - interface ITransitTimeRow { - - /** TransitTimeRow values */ - values?: (google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue[]|null); - } - - /** Represents a TransitTimeRow. */ - class TransitTimeRow implements ITransitTimeRow { - - /** - * Constructs a new TransitTimeRow. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow); - - /** TransitTimeRow values. */ - public values: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue[]; - - /** - * Creates a new TransitTimeRow instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitTimeRow instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow): google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow; - - /** - * Encodes the specified TransitTimeRow message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify|verify} messages. - * @param message TransitTimeRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitTimeRow message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify|verify} messages. - * @param message TransitTimeRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitTimeRow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitTimeRow - * @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.TransitTable.TransitTimeRow; - - /** - * Decodes a TransitTimeRow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitTimeRow - * @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.TransitTable.TransitTimeRow; - - /** - * Verifies a TransitTimeRow 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 TransitTimeRow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitTimeRow - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow; - - /** - * Creates a plain object from a TransitTimeRow message. Also converts values to other types if specified. - * @param message TransitTimeRow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitTimeRow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitTimeRow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TransitTimeRow { - - /** Properties of a TransitTimeValue. */ - interface ITransitTimeValue { - - /** TransitTimeValue minTransitDays */ - minTransitDays?: (number|null); - - /** TransitTimeValue maxTransitDays */ - maxTransitDays?: (number|null); - } - - /** Represents a TransitTimeValue. */ - class TransitTimeValue implements ITransitTimeValue { - - /** - * Constructs a new TransitTimeValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue); - - /** TransitTimeValue minTransitDays. */ - public minTransitDays?: (number|null); - - /** TransitTimeValue maxTransitDays. */ - public maxTransitDays?: (number|null); - - /** TransitTimeValue _minTransitDays. */ - public _minTransitDays?: "minTransitDays"; - - /** TransitTimeValue _maxTransitDays. */ - public _maxTransitDays?: "maxTransitDays"; - - /** - * Creates a new TransitTimeValue instance using the specified properties. - * @param [properties] Properties to set - * @returns TransitTimeValue instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue): google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue; - - /** - * Encodes the specified TransitTimeValue message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify|verify} messages. - * @param message TransitTimeValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TransitTimeValue message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify|verify} messages. - * @param message TransitTimeValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TransitTimeValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TransitTimeValue - * @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.TransitTable.TransitTimeRow.TransitTimeValue; - - /** - * Decodes a TransitTimeValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TransitTimeValue - * @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.TransitTable.TransitTimeRow.TransitTimeValue; - - /** - * Verifies a TransitTimeValue 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 TransitTimeValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransitTimeValue - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue; - - /** - * Creates a plain object from a TransitTimeValue message. Also converts values to other types if specified. - * @param message TransitTimeValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransitTimeValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransitTimeValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of a MinimumOrderValueTable. */ - interface IMinimumOrderValueTable { - - /** MinimumOrderValueTable storeCodeSetWithMovs */ - storeCodeSetWithMovs?: (google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov[]|null); - } - - /** Represents a MinimumOrderValueTable. */ - class MinimumOrderValueTable implements IMinimumOrderValueTable { - - /** - * Constructs a new MinimumOrderValueTable. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable); - - /** MinimumOrderValueTable storeCodeSetWithMovs. */ - public storeCodeSetWithMovs: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov[]; - - /** - * Creates a new MinimumOrderValueTable instance using the specified properties. - * @param [properties] Properties to set - * @returns MinimumOrderValueTable instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable): google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable; - - /** - * Encodes the specified MinimumOrderValueTable message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify|verify} messages. - * @param message MinimumOrderValueTable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MinimumOrderValueTable message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify|verify} messages. - * @param message MinimumOrderValueTable message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MinimumOrderValueTable message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MinimumOrderValueTable - * @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.MinimumOrderValueTable; - - /** - * Decodes a MinimumOrderValueTable message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MinimumOrderValueTable - * @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.MinimumOrderValueTable; - - /** - * Verifies a MinimumOrderValueTable 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 MinimumOrderValueTable message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MinimumOrderValueTable - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable; - - /** - * Creates a plain object from a MinimumOrderValueTable message. Also converts values to other types if specified. - * @param message MinimumOrderValueTable - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MinimumOrderValueTable to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MinimumOrderValueTable - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MinimumOrderValueTable { - - /** Properties of a StoreCodeSetWithMov. */ - interface IStoreCodeSetWithMov { - - /** StoreCodeSetWithMov storeCodes */ - storeCodes?: (string[]|null); - - /** StoreCodeSetWithMov value */ - value?: (google.shopping.type.IPrice|null); - } - - /** Represents a StoreCodeSetWithMov. */ - class StoreCodeSetWithMov implements IStoreCodeSetWithMov { - - /** - * Constructs a new StoreCodeSetWithMov. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov); - - /** StoreCodeSetWithMov storeCodes. */ - public storeCodes: string[]; - - /** StoreCodeSetWithMov value. */ - public value?: (google.shopping.type.IPrice|null); - - /** StoreCodeSetWithMov _value. */ - public _value?: "value"; - - /** - * Creates a new StoreCodeSetWithMov instance using the specified properties. - * @param [properties] Properties to set - * @returns StoreCodeSetWithMov instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov): google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov; - - /** - * Encodes the specified StoreCodeSetWithMov message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify|verify} messages. - * @param message StoreCodeSetWithMov message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StoreCodeSetWithMov message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify|verify} messages. - * @param message StoreCodeSetWithMov message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StoreCodeSetWithMov message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StoreCodeSetWithMov - * @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.MinimumOrderValueTable.StoreCodeSetWithMov; - - /** - * Decodes a StoreCodeSetWithMov message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StoreCodeSetWithMov - * @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.MinimumOrderValueTable.StoreCodeSetWithMov; - - /** - * Verifies a StoreCodeSetWithMov 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 StoreCodeSetWithMov message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StoreCodeSetWithMov - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov; - - /** - * Creates a plain object from a StoreCodeSetWithMov message. Also converts values to other types if specified. - * @param message StoreCodeSetWithMov - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StoreCodeSetWithMov to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StoreCodeSetWithMov - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a Headers. */ - interface IHeaders { - - /** Headers prices */ - prices?: (google.shopping.type.IPrice[]|null); - - /** Headers weights */ - weights?: (google.shopping.type.IWeight[]|null); - - /** Headers numberOfItems */ - numberOfItems?: (string[]|null); - - /** Headers postalCodeGroupNames */ - postalCodeGroupNames?: (string[]|null); - - /** Headers locations */ - locations?: (google.shopping.merchant.accounts.v1beta.ILocationIdSet[]|null); - } - - /** Represents a Headers. */ - class Headers implements IHeaders { - - /** - * Constructs a new Headers. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IHeaders); - - /** Headers prices. */ - public prices: google.shopping.type.IPrice[]; - - /** Headers weights. */ - public weights: google.shopping.type.IWeight[]; - - /** Headers numberOfItems. */ - public numberOfItems: string[]; - - /** Headers postalCodeGroupNames. */ - public postalCodeGroupNames: string[]; - - /** Headers locations. */ - public locations: google.shopping.merchant.accounts.v1beta.ILocationIdSet[]; - - /** - * Creates a new Headers instance using the specified properties. - * @param [properties] Properties to set - * @returns Headers instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IHeaders): google.shopping.merchant.accounts.v1beta.Headers; - - /** - * Encodes the specified Headers message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Headers.verify|verify} messages. - * @param message Headers message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IHeaders, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Headers message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Headers.verify|verify} messages. - * @param message Headers message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IHeaders, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Headers message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Headers - * @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.Headers; - - /** - * Decodes a Headers message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Headers - * @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.Headers; - - /** - * Verifies a Headers 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 Headers message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Headers - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Headers; - - /** - * Creates a plain object from a Headers message. Also converts values to other types if specified. - * @param message Headers - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Headers, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Headers to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Headers - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LocationIdSet. */ - interface ILocationIdSet { - - /** LocationIdSet locationIds */ - locationIds?: (string[]|null); - } - - /** Represents a LocationIdSet. */ - class LocationIdSet implements ILocationIdSet { - - /** - * Constructs a new LocationIdSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ILocationIdSet); - - /** LocationIdSet locationIds. */ - public locationIds: string[]; - - /** - * Creates a new LocationIdSet instance using the specified properties. - * @param [properties] Properties to set - * @returns LocationIdSet instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ILocationIdSet): google.shopping.merchant.accounts.v1beta.LocationIdSet; - - /** - * Encodes the specified LocationIdSet message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.LocationIdSet.verify|verify} messages. - * @param message LocationIdSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ILocationIdSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocationIdSet message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.LocationIdSet.verify|verify} messages. - * @param message LocationIdSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ILocationIdSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocationIdSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocationIdSet - * @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.LocationIdSet; - - /** - * Decodes a LocationIdSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocationIdSet - * @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.LocationIdSet; - - /** - * Verifies a LocationIdSet 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 LocationIdSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocationIdSet - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.LocationIdSet; - - /** - * Creates a plain object from a LocationIdSet message. Also converts values to other types if specified. - * @param message LocationIdSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.LocationIdSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocationIdSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocationIdSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Row. */ - interface IRow { - - /** Row cells */ - cells?: (google.shopping.merchant.accounts.v1beta.IValue[]|null); - } - - /** Represents a Row. */ - class Row implements IRow { - - /** - * Constructs a new Row. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IRow); - - /** Row cells. */ - public cells: google.shopping.merchant.accounts.v1beta.IValue[]; - - /** - * Creates a new Row instance using the specified properties. - * @param [properties] Properties to set - * @returns Row instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IRow): google.shopping.merchant.accounts.v1beta.Row; - - /** - * Encodes the specified Row message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Row.verify|verify} messages. - * @param message Row message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Row message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Row.verify|verify} messages. - * @param message Row message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Row message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Row - * @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.Row; - - /** - * Decodes a Row message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Row - * @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.Row; - - /** - * Verifies a Row 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 Row message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Row - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Row; - - /** - * Creates a plain object from a Row message. Also converts values to other types if specified. - * @param message Row - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Row to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Row - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value noShipping */ - noShipping?: (boolean|null); - - /** Value flatRate */ - flatRate?: (google.shopping.type.IPrice|null); - - /** Value pricePercentage */ - pricePercentage?: (string|null); - - /** Value carrierRate */ - carrierRate?: (string|null); - - /** Value subtable */ - subtable?: (string|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IValue); - - /** Value noShipping. */ - public noShipping?: (boolean|null); - - /** Value flatRate. */ - public flatRate?: (google.shopping.type.IPrice|null); - - /** Value pricePercentage. */ - public pricePercentage?: (string|null); - - /** Value carrierRate. */ - public carrierRate?: (string|null); - - /** Value subtable. */ - public subtable?: (string|null); - - /** Value _noShipping. */ - public _noShipping?: "noShipping"; - - /** Value _flatRate. */ - public _flatRate?: "flatRate"; - - /** Value _pricePercentage. */ - public _pricePercentage?: "pricePercentage"; - - /** Value _carrierRate. */ - public _carrierRate?: "carrierRate"; - - /** Value _subtable. */ - public _subtable?: "subtable"; - - /** - * Creates a new Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IValue): google.shopping.merchant.accounts.v1beta.Value; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Value - * @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.Value; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Value - * @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.Value; - - /** - * Verifies a Value 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 Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CarrierRate. */ - interface ICarrierRate { - - /** CarrierRate name */ - name?: (string|null); - - /** CarrierRate carrier */ - carrier?: (string|null); - - /** CarrierRate carrierService */ - carrierService?: (string|null); - - /** CarrierRate originPostalCode */ - originPostalCode?: (string|null); - - /** CarrierRate percentageAdjustment */ - percentageAdjustment?: (string|null); - - /** CarrierRate flatAdjustment */ - flatAdjustment?: (google.shopping.type.IPrice|null); - } - - /** Represents a CarrierRate. */ - class CarrierRate implements ICarrierRate { - - /** - * Constructs a new CarrierRate. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ICarrierRate); - - /** CarrierRate name. */ - public name?: (string|null); - - /** CarrierRate carrier. */ - public carrier?: (string|null); - - /** CarrierRate carrierService. */ - public carrierService?: (string|null); - - /** CarrierRate originPostalCode. */ - public originPostalCode?: (string|null); - - /** CarrierRate percentageAdjustment. */ - public percentageAdjustment?: (string|null); - - /** CarrierRate flatAdjustment. */ - public flatAdjustment?: (google.shopping.type.IPrice|null); - - /** CarrierRate _name. */ - public _name?: "name"; - - /** CarrierRate _carrier. */ - public _carrier?: "carrier"; - - /** CarrierRate _carrierService. */ - public _carrierService?: "carrierService"; - - /** CarrierRate _originPostalCode. */ - public _originPostalCode?: "originPostalCode"; - - /** CarrierRate _percentageAdjustment. */ - public _percentageAdjustment?: "percentageAdjustment"; - - /** CarrierRate _flatAdjustment. */ - public _flatAdjustment?: "flatAdjustment"; - - /** - * Creates a new CarrierRate instance using the specified properties. - * @param [properties] Properties to set - * @returns CarrierRate instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ICarrierRate): google.shopping.merchant.accounts.v1beta.CarrierRate; - - /** - * Encodes the specified CarrierRate message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CarrierRate.verify|verify} messages. - * @param message CarrierRate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ICarrierRate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CarrierRate message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CarrierRate.verify|verify} messages. - * @param message CarrierRate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ICarrierRate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CarrierRate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CarrierRate - * @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.CarrierRate; - - /** - * Decodes a CarrierRate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CarrierRate - * @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.CarrierRate; - - /** - * Verifies a CarrierRate 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 CarrierRate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CarrierRate - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.CarrierRate; - - /** - * Creates a plain object from a CarrierRate message. Also converts values to other types if specified. - * @param message CarrierRate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.CarrierRate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CarrierRate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CarrierRate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetShippingSettingsRequest. */ - interface IGetShippingSettingsRequest { - - /** GetShippingSettingsRequest name */ - name?: (string|null); - } - - /** Represents a GetShippingSettingsRequest. */ - class GetShippingSettingsRequest implements IGetShippingSettingsRequest { - - /** - * Constructs a new GetShippingSettingsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest); - - /** GetShippingSettingsRequest name. */ - public name: string; - - /** - * Creates a new GetShippingSettingsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetShippingSettingsRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest): google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest; - - /** - * Encodes the specified GetShippingSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest.verify|verify} messages. - * @param message GetShippingSettingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetShippingSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest.verify|verify} messages. - * @param message GetShippingSettingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetShippingSettingsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetShippingSettingsRequest - * @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.GetShippingSettingsRequest; - - /** - * Decodes a GetShippingSettingsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetShippingSettingsRequest - * @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.GetShippingSettingsRequest; - - /** - * Verifies a GetShippingSettingsRequest 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 GetShippingSettingsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetShippingSettingsRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest; - - /** - * Creates a plain object from a GetShippingSettingsRequest message. Also converts values to other types if specified. - * @param message GetShippingSettingsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetShippingSettingsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetShippingSettingsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InsertShippingSettingsRequest. */ - interface IInsertShippingSettingsRequest { - - /** InsertShippingSettingsRequest parent */ - parent?: (string|null); - - /** InsertShippingSettingsRequest shippingSetting */ - shippingSetting?: (google.shopping.merchant.accounts.v1beta.IShippingSettings|null); - } - - /** Represents an InsertShippingSettingsRequest. */ - class InsertShippingSettingsRequest implements IInsertShippingSettingsRequest { - - /** - * Constructs a new InsertShippingSettingsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest); - - /** InsertShippingSettingsRequest parent. */ - public parent: string; - - /** InsertShippingSettingsRequest shippingSetting. */ - public shippingSetting?: (google.shopping.merchant.accounts.v1beta.IShippingSettings|null); - - /** - * Creates a new InsertShippingSettingsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns InsertShippingSettingsRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest): google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest; - - /** - * Encodes the specified InsertShippingSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.verify|verify} messages. - * @param message InsertShippingSettingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InsertShippingSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.verify|verify} messages. - * @param message InsertShippingSettingsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InsertShippingSettingsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InsertShippingSettingsRequest - * @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.InsertShippingSettingsRequest; - - /** - * Decodes an InsertShippingSettingsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InsertShippingSettingsRequest - * @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.InsertShippingSettingsRequest; - - /** - * Verifies an InsertShippingSettingsRequest 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 InsertShippingSettingsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InsertShippingSettingsRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest; - - /** - * Creates a plain object from an InsertShippingSettingsRequest message. Also converts values to other types if specified. - * @param message InsertShippingSettingsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InsertShippingSettingsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InsertShippingSettingsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a TermsOfServiceService */ - class TermsOfServiceService extends $protobuf.rpc.Service { - - /** - * Constructs a new TermsOfServiceService 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 TermsOfServiceService 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): TermsOfServiceService; - - /** - * Calls GetTermsOfService. - * @param request GetTermsOfServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TermsOfService - */ - public getTermsOfService(request: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceService.GetTermsOfServiceCallback): void; - - /** - * Calls GetTermsOfService. - * @param request GetTermsOfServiceRequest message or plain object - * @returns Promise - */ - public getTermsOfService(request: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest): Promise; - - /** - * Calls RetrieveLatestTermsOfService. - * @param request RetrieveLatestTermsOfServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TermsOfService - */ - public retrieveLatestTermsOfService(request: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceService.RetrieveLatestTermsOfServiceCallback): void; - - /** - * Calls RetrieveLatestTermsOfService. - * @param request RetrieveLatestTermsOfServiceRequest message or plain object - * @returns Promise - */ - public retrieveLatestTermsOfService(request: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest): Promise; - - /** - * Calls AcceptTermsOfService. - * @param request AcceptTermsOfServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public acceptTermsOfService(request: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceService.AcceptTermsOfServiceCallback): void; - - /** - * Calls AcceptTermsOfService. - * @param request AcceptTermsOfServiceRequest message or plain object - * @returns Promise - */ - public acceptTermsOfService(request: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest): Promise; - } - - namespace TermsOfServiceService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|getTermsOfService}. - * @param error Error, if any - * @param [response] TermsOfService - */ - type GetTermsOfServiceCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.TermsOfService) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|retrieveLatestTermsOfService}. - * @param error Error, if any - * @param [response] TermsOfService - */ - type RetrieveLatestTermsOfServiceCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.TermsOfService) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|acceptTermsOfService}. - * @param error Error, if any - * @param [response] Empty - */ - type AcceptTermsOfServiceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of a TermsOfService. */ - interface ITermsOfService { - - /** TermsOfService name */ - name?: (string|null); - - /** TermsOfService regionCode */ - regionCode?: (string|null); - - /** TermsOfService kind */ - kind?: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null); - - /** TermsOfService fileUri */ - fileUri?: (string|null); - - /** TermsOfService external */ - external?: (boolean|null); - } - - /** Represents a TermsOfService. */ - class TermsOfService implements ITermsOfService { - - /** - * Constructs a new TermsOfService. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ITermsOfService); - - /** TermsOfService name. */ - public name: string; - - /** TermsOfService regionCode. */ - public regionCode: string; - - /** TermsOfService kind. */ - public kind: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind); - - /** TermsOfService fileUri. */ - public fileUri?: (string|null); - - /** TermsOfService external. */ - public external: boolean; - - /** TermsOfService _fileUri. */ - public _fileUri?: "fileUri"; - - /** - * Creates a new TermsOfService instance using the specified properties. - * @param [properties] Properties to set - * @returns TermsOfService instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ITermsOfService): google.shopping.merchant.accounts.v1beta.TermsOfService; - - /** - * Encodes the specified TermsOfService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfService.verify|verify} messages. - * @param message TermsOfService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ITermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TermsOfService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfService.verify|verify} messages. - * @param message TermsOfService message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITermsOfService, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TermsOfService message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TermsOfService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.shopping.merchant.accounts.v1beta.TermsOfService; - - /** - * Decodes a TermsOfService message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TermsOfService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.shopping.merchant.accounts.v1beta.TermsOfService; - - /** - * Verifies a TermsOfService message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TermsOfService message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TermsOfService - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TermsOfService; - - /** - * Creates a plain object from a TermsOfService message. Also converts values to other types if specified. - * @param message TermsOfService - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.TermsOfService, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TermsOfService to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TermsOfService - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTermsOfServiceRequest. */ - interface IGetTermsOfServiceRequest { - - /** GetTermsOfServiceRequest name */ - name?: (string|null); - } - - /** Represents a GetTermsOfServiceRequest. */ - class GetTermsOfServiceRequest implements IGetTermsOfServiceRequest { - - /** - * Constructs a new GetTermsOfServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest); - - /** GetTermsOfServiceRequest name. */ - public name: string; - - /** - * Creates a new GetTermsOfServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTermsOfServiceRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest): google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest; - - /** - * Encodes the specified GetTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest.verify|verify} messages. - * @param message GetTermsOfServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest.verify|verify} messages. - * @param message GetTermsOfServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTermsOfServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTermsOfServiceRequest - * @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.GetTermsOfServiceRequest; - - /** - * Decodes a GetTermsOfServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTermsOfServiceRequest - * @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.GetTermsOfServiceRequest; - - /** - * Verifies a GetTermsOfServiceRequest 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 GetTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTermsOfServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest; - - /** - * Creates a plain object from a GetTermsOfServiceRequest message. Also converts values to other types if specified. - * @param message GetTermsOfServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTermsOfServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTermsOfServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveLatestTermsOfServiceRequest. */ - interface IRetrieveLatestTermsOfServiceRequest { - - /** RetrieveLatestTermsOfServiceRequest regionCode */ - regionCode?: (string|null); - - /** RetrieveLatestTermsOfServiceRequest kind */ - kind?: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null); - } - - /** Represents a RetrieveLatestTermsOfServiceRequest. */ - class RetrieveLatestTermsOfServiceRequest implements IRetrieveLatestTermsOfServiceRequest { - - /** - * Constructs a new RetrieveLatestTermsOfServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest); - - /** RetrieveLatestTermsOfServiceRequest regionCode. */ - public regionCode: string; - - /** RetrieveLatestTermsOfServiceRequest kind. */ - public kind: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind); - - /** - * Creates a new RetrieveLatestTermsOfServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveLatestTermsOfServiceRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest): google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest; - - /** - * Encodes the specified RetrieveLatestTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest.verify|verify} messages. - * @param message RetrieveLatestTermsOfServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveLatestTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest.verify|verify} messages. - * @param message RetrieveLatestTermsOfServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveLatestTermsOfServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveLatestTermsOfServiceRequest - * @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.RetrieveLatestTermsOfServiceRequest; - - /** - * Decodes a RetrieveLatestTermsOfServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveLatestTermsOfServiceRequest - * @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.RetrieveLatestTermsOfServiceRequest; - - /** - * Verifies a RetrieveLatestTermsOfServiceRequest 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 RetrieveLatestTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveLatestTermsOfServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest; - - /** - * Creates a plain object from a RetrieveLatestTermsOfServiceRequest message. Also converts values to other types if specified. - * @param message RetrieveLatestTermsOfServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveLatestTermsOfServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveLatestTermsOfServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AcceptTermsOfServiceRequest. */ - interface IAcceptTermsOfServiceRequest { - - /** AcceptTermsOfServiceRequest name */ - name?: (string|null); - - /** AcceptTermsOfServiceRequest account */ - account?: (string|null); - - /** AcceptTermsOfServiceRequest regionCode */ - regionCode?: (string|null); - } - - /** Represents an AcceptTermsOfServiceRequest. */ - class AcceptTermsOfServiceRequest implements IAcceptTermsOfServiceRequest { - - /** - * Constructs a new AcceptTermsOfServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest); - - /** AcceptTermsOfServiceRequest name. */ - public name: string; - - /** AcceptTermsOfServiceRequest account. */ - public account: string; - - /** AcceptTermsOfServiceRequest regionCode. */ - public regionCode: string; - - /** - * Creates a new AcceptTermsOfServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AcceptTermsOfServiceRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest): google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest; - - /** - * Encodes the specified AcceptTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest.verify|verify} messages. - * @param message AcceptTermsOfServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AcceptTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest.verify|verify} messages. - * @param message AcceptTermsOfServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AcceptTermsOfServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AcceptTermsOfServiceRequest - * @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.AcceptTermsOfServiceRequest; - - /** - * Decodes an AcceptTermsOfServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AcceptTermsOfServiceRequest - * @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.AcceptTermsOfServiceRequest; - - /** - * Verifies an AcceptTermsOfServiceRequest 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 AcceptTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AcceptTermsOfServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest; - - /** - * Creates a plain object from an AcceptTermsOfServiceRequest message. Also converts values to other types if specified. - * @param message AcceptTermsOfServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AcceptTermsOfServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AcceptTermsOfServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** TermsOfServiceKind enum. */ - enum TermsOfServiceKind { - TERMS_OF_SERVICE_KIND_UNSPECIFIED = 0, - MERCHANT_CENTER = 1 - } - - /** Represents a TermsOfServiceAgreementStateService */ - class TermsOfServiceAgreementStateService extends $protobuf.rpc.Service { - - /** - * Constructs a new TermsOfServiceAgreementStateService 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 TermsOfServiceAgreementStateService 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): TermsOfServiceAgreementStateService; - - /** - * Calls GetTermsOfServiceAgreementState. - * @param request GetTermsOfServiceAgreementStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TermsOfServiceAgreementState - */ - public getTermsOfServiceAgreementState(request: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.GetTermsOfServiceAgreementStateCallback): void; - - /** - * Calls GetTermsOfServiceAgreementState. - * @param request GetTermsOfServiceAgreementStateRequest message or plain object - * @returns Promise - */ - public getTermsOfServiceAgreementState(request: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest): Promise; - - /** - * Calls RetrieveForApplicationTermsOfServiceAgreementState. - * @param request RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TermsOfServiceAgreementState - */ - public retrieveForApplicationTermsOfServiceAgreementState(request: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, callback: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.RetrieveForApplicationTermsOfServiceAgreementStateCallback): void; - - /** - * Calls RetrieveForApplicationTermsOfServiceAgreementState. - * @param request RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object - * @returns Promise - */ - public retrieveForApplicationTermsOfServiceAgreementState(request: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest): Promise; - } - - namespace TermsOfServiceAgreementStateService { - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService|getTermsOfServiceAgreementState}. - * @param error Error, if any - * @param [response] TermsOfServiceAgreementState - */ - type GetTermsOfServiceAgreementStateCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState) => void; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService|retrieveForApplicationTermsOfServiceAgreementState}. - * @param error Error, if any - * @param [response] TermsOfServiceAgreementState - */ - type RetrieveForApplicationTermsOfServiceAgreementStateCallback = (error: (Error|null), response?: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState) => void; - } - - /** Properties of a TermsOfServiceAgreementState. */ - interface ITermsOfServiceAgreementState { - - /** TermsOfServiceAgreementState name */ - name?: (string|null); - - /** TermsOfServiceAgreementState regionCode */ - regionCode?: (string|null); - - /** TermsOfServiceAgreementState termsOfServiceKind */ - termsOfServiceKind?: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null); - - /** TermsOfServiceAgreementState accepted */ - accepted?: (google.shopping.merchant.accounts.v1beta.IAccepted|null); - - /** TermsOfServiceAgreementState required */ - required?: (google.shopping.merchant.accounts.v1beta.IRequired|null); - } - - /** Represents a TermsOfServiceAgreementState. */ - class TermsOfServiceAgreementState implements ITermsOfServiceAgreementState { - - /** - * Constructs a new TermsOfServiceAgreementState. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState); - - /** TermsOfServiceAgreementState name. */ - public name: string; - - /** TermsOfServiceAgreementState regionCode. */ - public regionCode: string; - - /** TermsOfServiceAgreementState termsOfServiceKind. */ - public termsOfServiceKind: (google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|keyof typeof google.shopping.merchant.accounts.v1beta.TermsOfServiceKind); - - /** TermsOfServiceAgreementState accepted. */ - public accepted?: (google.shopping.merchant.accounts.v1beta.IAccepted|null); - - /** TermsOfServiceAgreementState required. */ - public required?: (google.shopping.merchant.accounts.v1beta.IRequired|null); - - /** TermsOfServiceAgreementState _accepted. */ - public _accepted?: "accepted"; - - /** TermsOfServiceAgreementState _required. */ - public _required?: "required"; - - /** - * Creates a new TermsOfServiceAgreementState instance using the specified properties. - * @param [properties] Properties to set - * @returns TermsOfServiceAgreementState instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState): google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState; - - /** - * Encodes the specified TermsOfServiceAgreementState message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.verify|verify} messages. - * @param message TermsOfServiceAgreementState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TermsOfServiceAgreementState message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.verify|verify} messages. - * @param message TermsOfServiceAgreementState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TermsOfServiceAgreementState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TermsOfServiceAgreementState - * @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.TermsOfServiceAgreementState; - - /** - * Decodes a TermsOfServiceAgreementState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TermsOfServiceAgreementState - * @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.TermsOfServiceAgreementState; - - /** - * Verifies a TermsOfServiceAgreementState 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 TermsOfServiceAgreementState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TermsOfServiceAgreementState - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState; - - /** - * Creates a plain object from a TermsOfServiceAgreementState message. Also converts values to other types if specified. - * @param message TermsOfServiceAgreementState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TermsOfServiceAgreementState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TermsOfServiceAgreementState - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Accepted. */ - interface IAccepted { - - /** Accepted termsOfService */ - termsOfService?: (string|null); - - /** Accepted acceptedBy */ - acceptedBy?: (string|null); - - /** Accepted validUntil */ - validUntil?: (google.type.IDate|null); - } - - /** Represents an Accepted. */ - class Accepted implements IAccepted { - - /** - * Constructs a new Accepted. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IAccepted); - - /** Accepted termsOfService. */ - public termsOfService: string; - - /** Accepted acceptedBy. */ - public acceptedBy: string; - - /** Accepted validUntil. */ - public validUntil?: (google.type.IDate|null); - - /** Accepted _validUntil. */ - public _validUntil?: "validUntil"; - - /** - * Creates a new Accepted instance using the specified properties. - * @param [properties] Properties to set - * @returns Accepted instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IAccepted): google.shopping.merchant.accounts.v1beta.Accepted; - - /** - * Encodes the specified Accepted message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Accepted.verify|verify} messages. - * @param message Accepted message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IAccepted, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Accepted message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Accepted.verify|verify} messages. - * @param message Accepted message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IAccepted, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Accepted message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Accepted - * @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.Accepted; - - /** - * Decodes an Accepted message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Accepted - * @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.Accepted; - - /** - * Verifies an Accepted 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 Accepted message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Accepted - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Accepted; - - /** - * Creates a plain object from an Accepted message. Also converts values to other types if specified. - * @param message Accepted - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Accepted, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Accepted to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Accepted - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Required. */ - interface IRequired { - - /** Required termsOfService */ - termsOfService?: (string|null); - - /** Required tosFileUri */ - tosFileUri?: (string|null); - } - - /** Represents a Required. */ - class Required implements IRequired { - - /** - * Constructs a new Required. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IRequired); - - /** Required termsOfService. */ - public termsOfService: string; - - /** Required tosFileUri. */ - public tosFileUri: string; - - /** - * Creates a new Required instance using the specified properties. - * @param [properties] Properties to set - * @returns Required instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IRequired): google.shopping.merchant.accounts.v1beta.Required; - - /** - * Encodes the specified Required message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Required.verify|verify} messages. - * @param message Required message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IRequired, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Required message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Required.verify|verify} messages. - * @param message Required message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRequired, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Required message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Required - * @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.Required; - - /** - * Decodes a Required message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Required - * @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.Required; - - /** - * Verifies a Required 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 Required message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Required - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.Required; - - /** - * Creates a plain object from a Required message. Also converts values to other types if specified. - * @param message Required - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.Required, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Required to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Required - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTermsOfServiceAgreementStateRequest. */ - interface IGetTermsOfServiceAgreementStateRequest { - - /** GetTermsOfServiceAgreementStateRequest name */ - name?: (string|null); - } - - /** Represents a GetTermsOfServiceAgreementStateRequest. */ - class GetTermsOfServiceAgreementStateRequest implements IGetTermsOfServiceAgreementStateRequest { - - /** - * Constructs a new GetTermsOfServiceAgreementStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest); - - /** GetTermsOfServiceAgreementStateRequest name. */ - public name: string; - - /** - * Creates a new GetTermsOfServiceAgreementStateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTermsOfServiceAgreementStateRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest): google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest; - - /** - * Encodes the specified GetTermsOfServiceAgreementStateRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest.verify|verify} messages. - * @param message GetTermsOfServiceAgreementStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTermsOfServiceAgreementStateRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest.verify|verify} messages. - * @param message GetTermsOfServiceAgreementStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTermsOfServiceAgreementStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTermsOfServiceAgreementStateRequest - * @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.GetTermsOfServiceAgreementStateRequest; - - /** - * Decodes a GetTermsOfServiceAgreementStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTermsOfServiceAgreementStateRequest - * @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.GetTermsOfServiceAgreementStateRequest; - - /** - * Verifies a GetTermsOfServiceAgreementStateRequest 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 GetTermsOfServiceAgreementStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTermsOfServiceAgreementStateRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest; - - /** - * Creates a plain object from a GetTermsOfServiceAgreementStateRequest message. Also converts values to other types if specified. - * @param message GetTermsOfServiceAgreementStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTermsOfServiceAgreementStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTermsOfServiceAgreementStateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetrieveForApplicationTermsOfServiceAgreementStateRequest. */ - interface IRetrieveForApplicationTermsOfServiceAgreementStateRequest { - - /** RetrieveForApplicationTermsOfServiceAgreementStateRequest parent */ - parent?: (string|null); - } - - /** Represents a RetrieveForApplicationTermsOfServiceAgreementStateRequest. */ - class RetrieveForApplicationTermsOfServiceAgreementStateRequest implements IRetrieveForApplicationTermsOfServiceAgreementStateRequest { - - /** - * Constructs a new RetrieveForApplicationTermsOfServiceAgreementStateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest); - - /** RetrieveForApplicationTermsOfServiceAgreementStateRequest parent. */ - public parent: string; - - /** - * Creates a new RetrieveForApplicationTermsOfServiceAgreementStateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RetrieveForApplicationTermsOfServiceAgreementStateRequest instance - */ - public static create(properties?: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest): google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest; - - /** - * Encodes the specified RetrieveForApplicationTermsOfServiceAgreementStateRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify|verify} messages. - * @param message RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetrieveForApplicationTermsOfServiceAgreementStateRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify|verify} messages. - * @param message RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @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.RetrieveForApplicationTermsOfServiceAgreementStateRequest; - - /** - * Decodes a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @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.RetrieveForApplicationTermsOfServiceAgreementStateRequest; - - /** - * Verifies a RetrieveForApplicationTermsOfServiceAgreementStateRequest 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 RetrieveForApplicationTermsOfServiceAgreementStateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetrieveForApplicationTermsOfServiceAgreementStateRequest - */ - public static fromObject(object: { [k: string]: any }): google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest; - - /** - * Creates a plain object from a RetrieveForApplicationTermsOfServiceAgreementStateRequest message. Also converts values to other types if specified. - * @param message RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetrieveForApplicationTermsOfServiceAgreementStateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of a Weight. */ - interface IWeight { - - /** Weight amountMicros */ - amountMicros?: (number|Long|string|null); - - /** Weight unit */ - unit?: (google.shopping.type.Weight.WeightUnit|keyof typeof google.shopping.type.Weight.WeightUnit|null); - } - - /** Represents a Weight. */ - class Weight implements IWeight { - - /** - * Constructs a new Weight. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.type.IWeight); - - /** Weight amountMicros. */ - public amountMicros?: (number|Long|string|null); - - /** Weight unit. */ - public unit: (google.shopping.type.Weight.WeightUnit|keyof typeof google.shopping.type.Weight.WeightUnit); - - /** Weight _amountMicros. */ - public _amountMicros?: "amountMicros"; - - /** - * Creates a new Weight instance using the specified properties. - * @param [properties] Properties to set - * @returns Weight instance - */ - public static create(properties?: google.shopping.type.IWeight): google.shopping.type.Weight; - - /** - * Encodes the specified Weight message. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages. - * @param message Weight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.type.IWeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages. - * @param message Weight message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.type.IWeight, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Weight message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Weight - * @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.type.Weight; - - /** - * Decodes a Weight message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Weight - * @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.type.Weight; - - /** - * Verifies a Weight 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 Weight message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Weight - */ - public static fromObject(object: { [k: string]: any }): google.shopping.type.Weight; - - /** - * Creates a plain object from a Weight message. Also converts values to other types if specified. - * @param message Weight - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.type.Weight, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Weight to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Weight - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Weight { - - /** WeightUnit enum. */ - enum WeightUnit { - WEIGHT_UNIT_UNSPECIFIED = 0, - POUND = 1, - KILOGRAM = 2 - } - } - - /** Properties of a Price. */ - interface IPrice { - - /** Price amountMicros */ - amountMicros?: (number|Long|string|null); - - /** Price currencyCode */ - currencyCode?: (string|null); - } - - /** Represents a Price. */ - class Price implements IPrice { - - /** - * Constructs a new Price. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.type.IPrice); - - /** Price amountMicros. */ - public amountMicros?: (number|Long|string|null); - - /** Price currencyCode. */ - public currencyCode?: (string|null); - - /** Price _amountMicros. */ - public _amountMicros?: "amountMicros"; - - /** Price _currencyCode. */ - public _currencyCode?: "currencyCode"; - - /** - * Creates a new Price instance using the specified properties. - * @param [properties] Properties to set - * @returns Price instance - */ - public static create(properties?: google.shopping.type.IPrice): google.shopping.type.Price; - - /** - * Encodes the specified Price message. Does not implicitly {@link google.shopping.type.Price.verify|verify} messages. - * @param message Price message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.type.IPrice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Price message, length delimited. Does not implicitly {@link google.shopping.type.Price.verify|verify} messages. - * @param message Price message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.type.IPrice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Price message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Price - * @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.type.Price; - - /** - * Decodes a Price message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Price - * @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.type.Price; - - /** - * Verifies a Price 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 Price message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Price - */ - public static fromObject(object: { [k: string]: any }): google.shopping.type.Price; - - /** - * Creates a plain object from a Price message. Also converts values to other types if specified. - * @param message Price - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.type.Price, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Price to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Price - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomAttribute. */ - interface ICustomAttribute { - - /** CustomAttribute name */ - name?: (string|null); - - /** CustomAttribute value */ - value?: (string|null); - - /** CustomAttribute groupValues */ - groupValues?: (google.shopping.type.ICustomAttribute[]|null); - } - - /** Represents a CustomAttribute. */ - class CustomAttribute implements ICustomAttribute { - - /** - * Constructs a new CustomAttribute. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.type.ICustomAttribute); - - /** CustomAttribute name. */ - public name?: (string|null); - - /** CustomAttribute value. */ - public value?: (string|null); - - /** CustomAttribute groupValues. */ - public groupValues: google.shopping.type.ICustomAttribute[]; - - /** CustomAttribute _name. */ - public _name?: "name"; - - /** CustomAttribute _value. */ - public _value?: "value"; - - /** - * Creates a new CustomAttribute instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomAttribute instance - */ - public static create(properties?: google.shopping.type.ICustomAttribute): google.shopping.type.CustomAttribute; - - /** - * Encodes the specified CustomAttribute message. Does not implicitly {@link google.shopping.type.CustomAttribute.verify|verify} messages. - * @param message CustomAttribute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.type.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.shopping.type.CustomAttribute.verify|verify} messages. - * @param message CustomAttribute message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.type.ICustomAttribute, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomAttribute message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomAttribute - * @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.type.CustomAttribute; - - /** - * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomAttribute - * @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.type.CustomAttribute; - - /** - * Verifies a CustomAttribute 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 CustomAttribute message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomAttribute - */ - public static fromObject(object: { [k: string]: any }): google.shopping.type.CustomAttribute; - - /** - * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. - * @param message CustomAttribute - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.type.CustomAttribute, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomAttribute to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomAttribute - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Destination. */ - interface IDestination { - } - - /** Represents a Destination. */ - class Destination implements IDestination { - - /** - * Constructs a new Destination. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.type.IDestination); - - /** - * Creates a new Destination instance using the specified properties. - * @param [properties] Properties to set - * @returns Destination instance - */ - public static create(properties?: google.shopping.type.IDestination): google.shopping.type.Destination; - - /** - * Encodes the specified Destination message. Does not implicitly {@link google.shopping.type.Destination.verify|verify} messages. - * @param message Destination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.type.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.shopping.type.Destination.verify|verify} messages. - * @param message Destination message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.type.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Destination message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Destination - * @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.type.Destination; - - /** - * Decodes a Destination message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Destination - * @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.type.Destination; - - /** - * Verifies a Destination 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 Destination message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Destination - */ - public static fromObject(object: { [k: string]: any }): google.shopping.type.Destination; - - /** - * Creates a plain object from a Destination message. Also converts values to other types if specified. - * @param message Destination - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.type.Destination, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Destination to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Destination - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Destination { - - /** DestinationEnum enum. */ - enum DestinationEnum { - DESTINATION_ENUM_UNSPECIFIED = 0, - SHOPPING_ADS = 1, - DISPLAY_ADS = 2, - LOCAL_INVENTORY_ADS = 3, - FREE_LISTINGS = 4, - FREE_LOCAL_LISTINGS = 5, - YOUTUBE_SHOPPING = 6 - } - } - - /** Properties of a ReportingContext. */ - interface IReportingContext { - } - - /** Represents a ReportingContext. */ - class ReportingContext implements IReportingContext { - - /** - * Constructs a new ReportingContext. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.type.IReportingContext); - - /** - * Creates a new ReportingContext instance using the specified properties. - * @param [properties] Properties to set - * @returns ReportingContext instance - */ - public static create(properties?: google.shopping.type.IReportingContext): google.shopping.type.ReportingContext; - - /** - * Encodes the specified ReportingContext message. Does not implicitly {@link google.shopping.type.ReportingContext.verify|verify} messages. - * @param message ReportingContext message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.type.IReportingContext, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReportingContext message, length delimited. Does not implicitly {@link google.shopping.type.ReportingContext.verify|verify} messages. - * @param message ReportingContext message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.type.IReportingContext, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReportingContext message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReportingContext - * @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.type.ReportingContext; - - /** - * Decodes a ReportingContext message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReportingContext - * @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.type.ReportingContext; - - /** - * Verifies a ReportingContext 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 ReportingContext message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReportingContext - */ - public static fromObject(object: { [k: string]: any }): google.shopping.type.ReportingContext; - - /** - * Creates a plain object from a ReportingContext message. Also converts values to other types if specified. - * @param message ReportingContext - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.type.ReportingContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReportingContext to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReportingContext - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReportingContext { - - /** ReportingContextEnum enum. */ - enum ReportingContextEnum { - REPORTING_CONTEXT_ENUM_UNSPECIFIED = 0, - SHOPPING_ADS = 1, - DISCOVERY_ADS = 2, - DEMAND_GEN_ADS = 13, - DEMAND_GEN_ADS_DISCOVER_SURFACE = 14, - VIDEO_ADS = 3, - DISPLAY_ADS = 4, - LOCAL_INVENTORY_ADS = 5, - VEHICLE_INVENTORY_ADS = 6, - FREE_LISTINGS = 7, - FREE_LOCAL_LISTINGS = 8, - FREE_LOCAL_VEHICLE_LISTINGS = 9, - YOUTUBE_SHOPPING = 10, - CLOUD_RETAIL = 11, - LOCAL_CLOUD_RETAIL = 12 - } - } - - /** Properties of a Channel. */ - interface IChannel { - } - - /** Represents a Channel. */ - class Channel implements IChannel { - - /** - * Constructs a new Channel. - * @param [properties] Properties to set - */ - constructor(properties?: google.shopping.type.IChannel); - - /** - * Creates a new Channel instance using the specified properties. - * @param [properties] Properties to set - * @returns Channel instance - */ - public static create(properties?: google.shopping.type.IChannel): google.shopping.type.Channel; - - /** - * Encodes the specified Channel message. Does not implicitly {@link google.shopping.type.Channel.verify|verify} messages. - * @param message Channel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.shopping.type.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Channel message, length delimited. Does not implicitly {@link google.shopping.type.Channel.verify|verify} messages. - * @param message Channel message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.shopping.type.IChannel, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Channel message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Channel - * @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.type.Channel; - - /** - * Decodes a Channel message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Channel - * @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.type.Channel; - - /** - * Verifies a Channel 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 Channel message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Channel - */ - public static fromObject(object: { [k: string]: any }): google.shopping.type.Channel; - - /** - * Creates a plain object from a Channel message. Also converts values to other types if specified. - * @param message Channel - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.shopping.type.Channel, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Channel to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Channel - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Channel { - - /** ChannelEnum enum. */ - enum ChannelEnum { - CHANNEL_ENUM_UNSPECIFIED = 0, - ONLINE = 1, - LOCAL = 2 - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http 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 Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule 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 HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions 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 ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions 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 MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption 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 UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart 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 NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation 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 Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration 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 Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; - - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp 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 Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; - - /** - * Verifies a DoubleValue 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 DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DoubleValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; - - /** - * Verifies a FloatValue 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 FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FloatValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|Long|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; - - /** - * Verifies an Int64Value 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 Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|Long|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new UInt64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt64Value instance - */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; - - /** - * Verifies a UInt64Value 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 UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates a new Int32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int32Value instance - */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; - - /** - * Verifies an Int32Value 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 Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt32Value instance - */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; - - /** - * Verifies a UInt32Value 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 UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a new BoolValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BoolValue instance - */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; - - /** - * Verifies a BoolValue 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 BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoolValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a new StringValue instance using the specified properties. - * @param [properties] Properties to set - * @returns StringValue instance - */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; - - /** - * Verifies a StringValue 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 StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|string|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: (Uint8Array|string); - - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; - - /** - * Verifies a BytesValue 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 BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BytesValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Interval. */ - interface IInterval { - - /** Interval startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an Interval. */ - class Interval implements IInterval { - - /** - * Constructs a new Interval. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IInterval); - - /** Interval startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Interval instance using the specified properties. - * @param [properties] Properties to set - * @returns Interval instance - */ - public static create(properties?: google.type.IInterval): google.type.Interval; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Interval - * @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.type.Interval; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Interval - * @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.type.Interval; - - /** - * Verifies an Interval 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 Interval message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Interval - */ - public static fromObject(object: { [k: string]: any }): google.type.Interval; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @param message Interval - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Interval to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Interval - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DateTime. */ - interface IDateTime { - - /** DateTime year */ - year?: (number|null); - - /** DateTime month */ - month?: (number|null); - - /** DateTime day */ - day?: (number|null); - - /** DateTime hours */ - hours?: (number|null); - - /** DateTime minutes */ - minutes?: (number|null); - - /** DateTime seconds */ - seconds?: (number|null); - - /** DateTime nanos */ - nanos?: (number|null); - - /** DateTime utcOffset */ - utcOffset?: (google.protobuf.IDuration|null); - - /** DateTime timeZone */ - timeZone?: (google.type.ITimeZone|null); - } - - /** Represents a DateTime. */ - class DateTime implements IDateTime { - - /** - * Constructs a new DateTime. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IDateTime); - - /** DateTime year. */ - public year: number; - - /** DateTime month. */ - public month: number; - - /** DateTime day. */ - public day: number; - - /** DateTime hours. */ - public hours: number; - - /** DateTime minutes. */ - public minutes: number; - - /** DateTime seconds. */ - public seconds: number; - - /** DateTime nanos. */ - public nanos: number; - - /** DateTime utcOffset. */ - public utcOffset?: (google.protobuf.IDuration|null); - - /** DateTime timeZone. */ - public timeZone?: (google.type.ITimeZone|null); - - /** DateTime timeOffset. */ - public timeOffset?: ("utcOffset"|"timeZone"); - - /** - * Creates a new DateTime instance using the specified properties. - * @param [properties] Properties to set - * @returns DateTime instance - */ - public static create(properties?: google.type.IDateTime): google.type.DateTime; - - /** - * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. - * @param message DateTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. - * @param message DateTime message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IDateTime, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DateTime message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DateTime - * @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.type.DateTime; - - /** - * Decodes a DateTime message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DateTime - * @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.type.DateTime; - - /** - * Verifies a DateTime 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 DateTime message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DateTime - */ - public static fromObject(object: { [k: string]: any }): google.type.DateTime; - - /** - * Creates a plain object from a DateTime message. Also converts values to other types if specified. - * @param message DateTime - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.DateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DateTime to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DateTime - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TimeZone. */ - interface ITimeZone { - - /** TimeZone id */ - id?: (string|null); - - /** TimeZone version */ - version?: (string|null); - } - - /** Represents a TimeZone. */ - class TimeZone implements ITimeZone { - - /** - * Constructs a new TimeZone. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ITimeZone); - - /** TimeZone id. */ - public id: string; - - /** TimeZone version. */ - public version: string; - - /** - * Creates a new TimeZone instance using the specified properties. - * @param [properties] Properties to set - * @returns TimeZone instance - */ - public static create(properties?: google.type.ITimeZone): google.type.TimeZone; - - /** - * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. - * @param message TimeZone message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. - * @param message TimeZone message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.ITimeZone, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimeZone message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimeZone - * @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.type.TimeZone; - - /** - * Decodes a TimeZone message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimeZone - * @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.type.TimeZone; - - /** - * Verifies a TimeZone 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 TimeZone message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimeZone - */ - public static fromObject(object: { [k: string]: any }): google.type.TimeZone; - - /** - * Creates a plain object from a TimeZone message. Also converts values to other types if specified. - * @param message TimeZone - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.TimeZone, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimeZone to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimeZone - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhoneNumber. */ - interface IPhoneNumber { - - /** PhoneNumber e164Number */ - e164Number?: (string|null); - - /** PhoneNumber shortCode */ - shortCode?: (google.type.PhoneNumber.IShortCode|null); - - /** PhoneNumber extension */ - extension?: (string|null); - } - - /** Represents a PhoneNumber. */ - class PhoneNumber implements IPhoneNumber { - - /** - * Constructs a new PhoneNumber. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IPhoneNumber); - - /** PhoneNumber e164Number. */ - public e164Number?: (string|null); - - /** PhoneNumber shortCode. */ - public shortCode?: (google.type.PhoneNumber.IShortCode|null); - - /** PhoneNumber extension. */ - public extension: string; - - /** PhoneNumber kind. */ - public kind?: ("e164Number"|"shortCode"); - - /** - * Creates a new PhoneNumber instance using the specified properties. - * @param [properties] Properties to set - * @returns PhoneNumber instance - */ - public static create(properties?: google.type.IPhoneNumber): google.type.PhoneNumber; - - /** - * Encodes the specified PhoneNumber message. Does not implicitly {@link google.type.PhoneNumber.verify|verify} messages. - * @param message PhoneNumber message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IPhoneNumber, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhoneNumber message, length delimited. Does not implicitly {@link google.type.PhoneNumber.verify|verify} messages. - * @param message PhoneNumber message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IPhoneNumber, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhoneNumber message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhoneNumber - * @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.type.PhoneNumber; - - /** - * Decodes a PhoneNumber message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhoneNumber - * @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.type.PhoneNumber; - - /** - * Verifies a PhoneNumber 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 PhoneNumber message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhoneNumber - */ - public static fromObject(object: { [k: string]: any }): google.type.PhoneNumber; - - /** - * Creates a plain object from a PhoneNumber message. Also converts values to other types if specified. - * @param message PhoneNumber - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.PhoneNumber, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhoneNumber to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhoneNumber - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PhoneNumber { - - /** Properties of a ShortCode. */ - interface IShortCode { - - /** ShortCode regionCode */ - regionCode?: (string|null); - - /** ShortCode number */ - number?: (string|null); - } - - /** Represents a ShortCode. */ - class ShortCode implements IShortCode { - - /** - * Constructs a new ShortCode. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.PhoneNumber.IShortCode); - - /** ShortCode regionCode. */ - public regionCode: string; - - /** ShortCode number. */ - public number: string; - - /** - * Creates a new ShortCode instance using the specified properties. - * @param [properties] Properties to set - * @returns ShortCode instance - */ - public static create(properties?: google.type.PhoneNumber.IShortCode): google.type.PhoneNumber.ShortCode; - - /** - * Encodes the specified ShortCode message. Does not implicitly {@link google.type.PhoneNumber.ShortCode.verify|verify} messages. - * @param message ShortCode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.PhoneNumber.IShortCode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShortCode message, length delimited. Does not implicitly {@link google.type.PhoneNumber.ShortCode.verify|verify} messages. - * @param message ShortCode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.PhoneNumber.IShortCode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShortCode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShortCode - * @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.type.PhoneNumber.ShortCode; - - /** - * Decodes a ShortCode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShortCode - * @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.type.PhoneNumber.ShortCode; - - /** - * Verifies a ShortCode 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 ShortCode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShortCode - */ - public static fromObject(object: { [k: string]: any }): google.type.PhoneNumber.ShortCode; - - /** - * Creates a plain object from a ShortCode message. Also converts values to other types if specified. - * @param message ShortCode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.PhoneNumber.ShortCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShortCode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShortCode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a PostalAddress. */ - interface IPostalAddress { - - /** PostalAddress revision */ - revision?: (number|null); - - /** PostalAddress regionCode */ - regionCode?: (string|null); - - /** PostalAddress languageCode */ - languageCode?: (string|null); - - /** PostalAddress postalCode */ - postalCode?: (string|null); - - /** PostalAddress sortingCode */ - sortingCode?: (string|null); - - /** PostalAddress administrativeArea */ - administrativeArea?: (string|null); - - /** PostalAddress locality */ - locality?: (string|null); - - /** PostalAddress sublocality */ - sublocality?: (string|null); - - /** PostalAddress addressLines */ - addressLines?: (string[]|null); - - /** PostalAddress recipients */ - recipients?: (string[]|null); - - /** PostalAddress organization */ - organization?: (string|null); - } - - /** Represents a PostalAddress. */ - class PostalAddress implements IPostalAddress { - - /** - * Constructs a new PostalAddress. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IPostalAddress); - - /** PostalAddress revision. */ - public revision: number; - - /** PostalAddress regionCode. */ - public regionCode: string; - - /** PostalAddress languageCode. */ - public languageCode: string; - - /** PostalAddress postalCode. */ - public postalCode: string; - - /** PostalAddress sortingCode. */ - public sortingCode: string; - - /** PostalAddress administrativeArea. */ - public administrativeArea: string; - - /** PostalAddress locality. */ - public locality: string; - - /** PostalAddress sublocality. */ - public sublocality: string; - - /** PostalAddress addressLines. */ - public addressLines: string[]; - - /** PostalAddress recipients. */ - public recipients: string[]; - - /** PostalAddress organization. */ - public organization: string; - - /** - * Creates a new PostalAddress instance using the specified properties. - * @param [properties] Properties to set - * @returns PostalAddress instance - */ - public static create(properties?: google.type.IPostalAddress): google.type.PostalAddress; - - /** - * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. - * @param message PostalAddress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. - * @param message PostalAddress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IPostalAddress, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PostalAddress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PostalAddress - * @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.type.PostalAddress; - - /** - * Decodes a PostalAddress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PostalAddress - * @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.type.PostalAddress; - - /** - * Verifies a PostalAddress 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 PostalAddress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PostalAddress - */ - public static fromObject(object: { [k: string]: any }): google.type.PostalAddress; - - /** - * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. - * @param message PostalAddress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.PostalAddress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PostalAddress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PostalAddress - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Date. */ - interface IDate { - - /** Date year */ - year?: (number|null); - - /** Date month */ - month?: (number|null); - - /** Date day */ - day?: (number|null); - } - - /** Represents a Date. */ - class Date implements IDate { - - /** - * Constructs a new Date. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IDate); - - /** Date year. */ - public year: number; - - /** Date month. */ - public month: number; - - /** Date day. */ - public day: number; - - /** - * Creates a new Date instance using the specified properties. - * @param [properties] Properties to set - * @returns Date instance - */ - public static create(properties?: google.type.IDate): google.type.Date; - - /** - * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @param message Date message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @param message Date message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Date message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Date - * @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.type.Date; - - /** - * Decodes a Date message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Date - * @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.type.Date; - - /** - * Verifies a Date 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 Date message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Date - */ - public static fromObject(object: { [k: string]: any }): google.type.Date; - - /** - * Creates a plain object from a Date message. Also converts values to other types if specified. - * @param message Date - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Date to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Date - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.js deleted file mode 100644 index 3052ae48151..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.js +++ /dev/null @@ -1,57252 +0,0 @@ -// 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. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_shopping_accounts_protos || ($protobuf.roots._google_shopping_accounts_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.shopping = (function() { - - /** - * Namespace shopping. - * @memberof google - * @namespace - */ - var shopping = {}; - - shopping.merchant = (function() { - - /** - * Namespace merchant. - * @memberof google.shopping - * @namespace - */ - var merchant = {}; - - merchant.accounts = (function() { - - /** - * Namespace accounts. - * @memberof google.shopping.merchant - * @namespace - */ - var accounts = {}; - - accounts.v1beta = (function() { - - /** - * Namespace v1beta. - * @memberof google.shopping.merchant.accounts - * @namespace - */ - var v1beta = {}; - - /** - * AccessRight enum. - * @name google.shopping.merchant.accounts.v1beta.AccessRight - * @enum {number} - * @property {number} ACCESS_RIGHT_UNSPECIFIED=0 ACCESS_RIGHT_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} ADMIN=2 ADMIN value - * @property {number} PERFORMANCE_REPORTING=3 PERFORMANCE_REPORTING value - */ - v1beta.AccessRight = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACCESS_RIGHT_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "ADMIN"] = 2; - values[valuesById[3] = "PERFORMANCE_REPORTING"] = 3; - return values; - })(); - - v1beta.AccountTaxService = (function() { - - /** - * Constructs a new AccountTaxService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an AccountTaxService - * @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 AccountTaxService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AccountTaxService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AccountTaxService; - - /** - * Creates new AccountTaxService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @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 {AccountTaxService} RPC service. Useful where requests and/or responses are streamed. - */ - AccountTaxService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|getAccountTax}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @typedef GetAccountTaxCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.AccountTax} [response] AccountTax - */ - - /** - * Calls GetAccountTax. - * @function getAccountTax - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest} request GetAccountTaxRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountTaxService.GetAccountTaxCallback} callback Node-style callback called with the error, if any, and AccountTax - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountTaxService.prototype.getAccountTax = function getAccountTax(request, callback) { - return this.rpcCall(getAccountTax, $root.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest, $root.google.shopping.merchant.accounts.v1beta.AccountTax, request, callback); - }, "name", { value: "GetAccountTax" }); - - /** - * Calls GetAccountTax. - * @function getAccountTax - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest} request GetAccountTaxRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|listAccountTax}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @typedef ListAccountTaxCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} [response] ListAccountTaxResponse - */ - - /** - * Calls ListAccountTax. - * @function listAccountTax - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest} request ListAccountTaxRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountTaxService.ListAccountTaxCallback} callback Node-style callback called with the error, if any, and ListAccountTaxResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountTaxService.prototype.listAccountTax = function listAccountTax(request, callback) { - return this.rpcCall(listAccountTax, $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest, $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse, request, callback); - }, "name", { value: "ListAccountTax" }); - - /** - * Calls ListAccountTax. - * @function listAccountTax - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest} request ListAccountTaxRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountTaxService|updateAccountTax}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @typedef UpdateAccountTaxCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.AccountTax} [response] AccountTax - */ - - /** - * Calls UpdateAccountTax. - * @function updateAccountTax - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest} request UpdateAccountTaxRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountTaxService.UpdateAccountTaxCallback} callback Node-style callback called with the error, if any, and AccountTax - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountTaxService.prototype.updateAccountTax = function updateAccountTax(request, callback) { - return this.rpcCall(updateAccountTax, $root.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest, $root.google.shopping.merchant.accounts.v1beta.AccountTax, request, callback); - }, "name", { value: "UpdateAccountTax" }); - - /** - * Calls UpdateAccountTax. - * @function updateAccountTax - * @memberof google.shopping.merchant.accounts.v1beta.AccountTaxService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest} request UpdateAccountTaxRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AccountTaxService; - })(); - - v1beta.AccountTax = (function() { - - /** - * Properties of an AccountTax. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IAccountTax - * @property {string|null} [name] AccountTax name - * @property {number|Long|null} [account] AccountTax account - * @property {Array.|null} [taxRules] AccountTax taxRules - */ - - /** - * Constructs a new AccountTax. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an AccountTax. - * @implements IAccountTax - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IAccountTax=} [properties] Properties to set - */ - function AccountTax(properties) { - this.taxRules = []; - 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]]; - } - - /** - * AccountTax name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @instance - */ - AccountTax.prototype.name = ""; - - /** - * AccountTax account. - * @member {number|Long} account - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @instance - */ - AccountTax.prototype.account = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * AccountTax taxRules. - * @member {Array.} taxRules - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @instance - */ - AccountTax.prototype.taxRules = $util.emptyArray; - - /** - * Creates a new AccountTax instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccountTax=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.AccountTax} AccountTax instance - */ - AccountTax.create = function create(properties) { - return new AccountTax(properties); - }; - - /** - * Encodes the specified AccountTax message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountTax.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccountTax} message AccountTax message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccountTax.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.account != null && Object.hasOwnProperty.call(message, "account")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.account); - if (message.taxRules != null && message.taxRules.length) - for (var i = 0; i < message.taxRules.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.TaxRule.encode(message.taxRules[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AccountTax message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountTax.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccountTax} message AccountTax message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccountTax.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccountTax message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @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.AccountTax} AccountTax - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccountTax.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.AccountTax(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.account = reader.int64(); - break; - } - case 3: { - if (!(message.taxRules && message.taxRules.length)) - message.taxRules = []; - message.taxRules.push($root.google.shopping.merchant.accounts.v1beta.TaxRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccountTax message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.AccountTax} AccountTax - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccountTax.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccountTax message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccountTax.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.account != null && message.hasOwnProperty("account")) - if (!$util.isInteger(message.account) && !(message.account && $util.isInteger(message.account.low) && $util.isInteger(message.account.high))) - return "account: integer|Long expected"; - if (message.taxRules != null && message.hasOwnProperty("taxRules")) { - if (!Array.isArray(message.taxRules)) - return "taxRules: array expected"; - for (var i = 0; i < message.taxRules.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.TaxRule.verify(message.taxRules[i]); - if (error) - return "taxRules." + error; - } - } - return null; - }; - - /** - * Creates an AccountTax message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.AccountTax} AccountTax - */ - AccountTax.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AccountTax) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.AccountTax(); - if (object.name != null) - message.name = String(object.name); - if (object.account != null) - if ($util.Long) - (message.account = $util.Long.fromValue(object.account)).unsigned = false; - else if (typeof object.account === "string") - message.account = parseInt(object.account, 10); - else if (typeof object.account === "number") - message.account = object.account; - else if (typeof object.account === "object") - message.account = new $util.LongBits(object.account.low >>> 0, object.account.high >>> 0).toNumber(); - if (object.taxRules) { - if (!Array.isArray(object.taxRules)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountTax.taxRules: array expected"); - message.taxRules = []; - for (var i = 0; i < object.taxRules.length; ++i) { - if (typeof object.taxRules[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountTax.taxRules: object expected"); - message.taxRules[i] = $root.google.shopping.merchant.accounts.v1beta.TaxRule.fromObject(object.taxRules[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AccountTax message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountTax} message AccountTax - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccountTax.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.taxRules = []; - if (options.defaults) { - object.name = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.account = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.account = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.account != null && message.hasOwnProperty("account")) - if (typeof message.account === "number") - object.account = options.longs === String ? String(message.account) : message.account; - else - object.account = options.longs === String ? $util.Long.prototype.toString.call(message.account) : options.longs === Number ? new $util.LongBits(message.account.low >>> 0, message.account.high >>> 0).toNumber() : message.account; - if (message.taxRules && message.taxRules.length) { - object.taxRules = []; - for (var j = 0; j < message.taxRules.length; ++j) - object.taxRules[j] = $root.google.shopping.merchant.accounts.v1beta.TaxRule.toObject(message.taxRules[j], options); - } - return object; - }; - - /** - * Converts this AccountTax to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @instance - * @returns {Object.} JSON object - */ - AccountTax.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AccountTax - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.AccountTax - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AccountTax.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AccountTax"; - }; - - return AccountTax; - })(); - - v1beta.GetAccountTaxRequest = (function() { - - /** - * Properties of a GetAccountTaxRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetAccountTaxRequest - * @property {string|null} [name] GetAccountTaxRequest name - */ - - /** - * Constructs a new GetAccountTaxRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetAccountTaxRequest. - * @implements IGetAccountTaxRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest=} [properties] Properties to set - */ - function GetAccountTaxRequest(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]]; - } - - /** - * GetAccountTaxRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @instance - */ - GetAccountTaxRequest.prototype.name = ""; - - /** - * Creates a new GetAccountTaxRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest} GetAccountTaxRequest instance - */ - GetAccountTaxRequest.create = function create(properties) { - return new GetAccountTaxRequest(properties); - }; - - /** - * Encodes the specified GetAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest} message GetAccountTaxRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAccountTaxRequest.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 GetAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest} message GetAccountTaxRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAccountTaxRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAccountTaxRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @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.GetAccountTaxRequest} GetAccountTaxRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAccountTaxRequest.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.GetAccountTaxRequest(); - 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 GetAccountTaxRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest} GetAccountTaxRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAccountTaxRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAccountTaxRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAccountTaxRequest.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 GetAccountTaxRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest} GetAccountTaxRequest - */ - GetAccountTaxRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAccountTaxRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest} message GetAccountTaxRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAccountTaxRequest.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 GetAccountTaxRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @instance - * @returns {Object.} JSON object - */ - GetAccountTaxRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAccountTaxRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAccountTaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest"; - }; - - return GetAccountTaxRequest; - })(); - - v1beta.UpdateAccountTaxRequest = (function() { - - /** - * Properties of an UpdateAccountTaxRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUpdateAccountTaxRequest - * @property {google.shopping.merchant.accounts.v1beta.IAccountTax|null} [accountTax] UpdateAccountTaxRequest accountTax - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAccountTaxRequest updateMask - */ - - /** - * Constructs a new UpdateAccountTaxRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an UpdateAccountTaxRequest. - * @implements IUpdateAccountTaxRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest=} [properties] Properties to set - */ - function UpdateAccountTaxRequest(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]]; - } - - /** - * UpdateAccountTaxRequest accountTax. - * @member {google.shopping.merchant.accounts.v1beta.IAccountTax|null|undefined} accountTax - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @instance - */ - UpdateAccountTaxRequest.prototype.accountTax = null; - - /** - * UpdateAccountTaxRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @instance - */ - UpdateAccountTaxRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateAccountTaxRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest} UpdateAccountTaxRequest instance - */ - UpdateAccountTaxRequest.create = function create(properties) { - return new UpdateAccountTaxRequest(properties); - }; - - /** - * Encodes the specified UpdateAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest} message UpdateAccountTaxRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAccountTaxRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.accountTax != null && Object.hasOwnProperty.call(message, "accountTax")) - $root.google.shopping.merchant.accounts.v1beta.AccountTax.encode(message.accountTax, 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 UpdateAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest} message UpdateAccountTaxRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAccountTaxRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateAccountTaxRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @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.UpdateAccountTaxRequest} UpdateAccountTaxRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAccountTaxRequest.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.UpdateAccountTaxRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.accountTax = $root.google.shopping.merchant.accounts.v1beta.AccountTax.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 UpdateAccountTaxRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest} UpdateAccountTaxRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAccountTaxRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateAccountTaxRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateAccountTaxRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.accountTax != null && message.hasOwnProperty("accountTax")) { - var error = $root.google.shopping.merchant.accounts.v1beta.AccountTax.verify(message.accountTax); - if (error) - return "accountTax." + 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 UpdateAccountTaxRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest} UpdateAccountTaxRequest - */ - UpdateAccountTaxRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest(); - if (object.accountTax != null) { - if (typeof object.accountTax !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.accountTax: object expected"); - message.accountTax = $root.google.shopping.merchant.accounts.v1beta.AccountTax.fromObject(object.accountTax); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateAccountTaxRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest} message UpdateAccountTaxRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateAccountTaxRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.accountTax = null; - object.updateMask = null; - } - if (message.accountTax != null && message.hasOwnProperty("accountTax")) - object.accountTax = $root.google.shopping.merchant.accounts.v1beta.AccountTax.toObject(message.accountTax, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateAccountTaxRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateAccountTaxRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateAccountTaxRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateAccountTaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest"; - }; - - return UpdateAccountTaxRequest; - })(); - - v1beta.ListAccountTaxRequest = (function() { - - /** - * Properties of a ListAccountTaxRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListAccountTaxRequest - * @property {string|null} [parent] ListAccountTaxRequest parent - * @property {number|null} [pageSize] ListAccountTaxRequest pageSize - * @property {string|null} [pageToken] ListAccountTaxRequest pageToken - */ - - /** - * Constructs a new ListAccountTaxRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListAccountTaxRequest. - * @implements IListAccountTaxRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest=} [properties] Properties to set - */ - function ListAccountTaxRequest(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]]; - } - - /** - * ListAccountTaxRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @instance - */ - ListAccountTaxRequest.prototype.parent = ""; - - /** - * ListAccountTaxRequest pageSize. - * @member {number} pageSize - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @instance - */ - ListAccountTaxRequest.prototype.pageSize = 0; - - /** - * ListAccountTaxRequest pageToken. - * @member {string} pageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @instance - */ - ListAccountTaxRequest.prototype.pageToken = ""; - - /** - * Creates a new ListAccountTaxRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest} ListAccountTaxRequest instance - */ - ListAccountTaxRequest.create = function create(properties) { - return new ListAccountTaxRequest(properties); - }; - - /** - * Encodes the specified ListAccountTaxRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest} message ListAccountTaxRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountTaxRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListAccountTaxRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest} message ListAccountTaxRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountTaxRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAccountTaxRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @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.ListAccountTaxRequest} ListAccountTaxRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountTaxRequest.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.ListAccountTaxRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAccountTaxRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest} ListAccountTaxRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountTaxRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAccountTaxRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAccountTaxRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListAccountTaxRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest} ListAccountTaxRequest - */ - ListAccountTaxRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListAccountTaxRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest} message ListAccountTaxRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAccountTaxRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListAccountTaxRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @instance - * @returns {Object.} JSON object - */ - ListAccountTaxRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAccountTaxRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAccountTaxRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest"; - }; - - return ListAccountTaxRequest; - })(); - - v1beta.ListAccountTaxResponse = (function() { - - /** - * Properties of a ListAccountTaxResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListAccountTaxResponse - * @property {Array.|null} [accountTaxes] ListAccountTaxResponse accountTaxes - * @property {string|null} [nextPageToken] ListAccountTaxResponse nextPageToken - */ - - /** - * Constructs a new ListAccountTaxResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListAccountTaxResponse. - * @implements IListAccountTaxResponse - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse=} [properties] Properties to set - */ - function ListAccountTaxResponse(properties) { - this.accountTaxes = []; - 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]]; - } - - /** - * ListAccountTaxResponse accountTaxes. - * @member {Array.} accountTaxes - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @instance - */ - ListAccountTaxResponse.prototype.accountTaxes = $util.emptyArray; - - /** - * ListAccountTaxResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @instance - */ - ListAccountTaxResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAccountTaxResponse instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} ListAccountTaxResponse instance - */ - ListAccountTaxResponse.create = function create(properties) { - return new ListAccountTaxResponse(properties); - }; - - /** - * Encodes the specified ListAccountTaxResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse} message ListAccountTaxResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountTaxResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.accountTaxes != null && message.accountTaxes.length) - for (var i = 0; i < message.accountTaxes.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.AccountTax.encode(message.accountTaxes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListAccountTaxResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse} message ListAccountTaxResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountTaxResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAccountTaxResponse message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @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.ListAccountTaxResponse} ListAccountTaxResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountTaxResponse.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.ListAccountTaxResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.accountTaxes && message.accountTaxes.length)) - message.accountTaxes = []; - message.accountTaxes.push($root.google.shopping.merchant.accounts.v1beta.AccountTax.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAccountTaxResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} ListAccountTaxResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountTaxResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAccountTaxResponse message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAccountTaxResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.accountTaxes != null && message.hasOwnProperty("accountTaxes")) { - if (!Array.isArray(message.accountTaxes)) - return "accountTaxes: array expected"; - for (var i = 0; i < message.accountTaxes.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.AccountTax.verify(message.accountTaxes[i]); - if (error) - return "accountTaxes." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAccountTaxResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} ListAccountTaxResponse - */ - ListAccountTaxResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse(); - if (object.accountTaxes) { - if (!Array.isArray(object.accountTaxes)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.accountTaxes: array expected"); - message.accountTaxes = []; - for (var i = 0; i < object.accountTaxes.length; ++i) { - if (typeof object.accountTaxes[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse.accountTaxes: object expected"); - message.accountTaxes[i] = $root.google.shopping.merchant.accounts.v1beta.AccountTax.fromObject(object.accountTaxes[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAccountTaxResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse} message ListAccountTaxResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAccountTaxResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.accountTaxes = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.accountTaxes && message.accountTaxes.length) { - object.accountTaxes = []; - for (var j = 0; j < message.accountTaxes.length; ++j) - object.accountTaxes[j] = $root.google.shopping.merchant.accounts.v1beta.AccountTax.toObject(message.accountTaxes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAccountTaxResponse to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @instance - * @returns {Object.} JSON object - */ - ListAccountTaxResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAccountTaxResponse - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAccountTaxResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse"; - }; - - return ListAccountTaxResponse; - })(); - - v1beta.TaxRule = (function() { - - /** - * Properties of a TaxRule. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ITaxRule - * @property {number|Long|null} [locationId] TaxRule locationId - * @property {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange|null} [postCodeRange] TaxRule postCodeRange - * @property {boolean|null} [useGoogleRate] TaxRule useGoogleRate - * @property {number|Long|null} [selfSpecifiedRateMicros] TaxRule selfSpecifiedRateMicros - * @property {string|null} [regionCode] TaxRule regionCode - * @property {boolean|null} [shippingTaxed] TaxRule shippingTaxed - * @property {google.type.IInterval|null} [effectiveTimePeriod] TaxRule effectiveTimePeriod - */ - - /** - * Constructs a new TaxRule. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a TaxRule. - * @implements ITaxRule - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ITaxRule=} [properties] Properties to set - */ - function TaxRule(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]]; - } - - /** - * TaxRule locationId. - * @member {number|Long|null|undefined} locationId - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - */ - TaxRule.prototype.locationId = null; - - /** - * TaxRule postCodeRange. - * @member {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange|null|undefined} postCodeRange - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - */ - TaxRule.prototype.postCodeRange = null; - - /** - * TaxRule useGoogleRate. - * @member {boolean|null|undefined} useGoogleRate - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - */ - TaxRule.prototype.useGoogleRate = null; - - /** - * TaxRule selfSpecifiedRateMicros. - * @member {number|Long|null|undefined} selfSpecifiedRateMicros - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - */ - TaxRule.prototype.selfSpecifiedRateMicros = null; - - /** - * TaxRule regionCode. - * @member {string} regionCode - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - */ - TaxRule.prototype.regionCode = ""; - - /** - * TaxRule shippingTaxed. - * @member {boolean} shippingTaxed - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - */ - TaxRule.prototype.shippingTaxed = false; - - /** - * TaxRule effectiveTimePeriod. - * @member {google.type.IInterval|null|undefined} effectiveTimePeriod - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - */ - TaxRule.prototype.effectiveTimePeriod = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TaxRule location. - * @member {"locationId"|"postCodeRange"|undefined} location - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - */ - Object.defineProperty(TaxRule.prototype, "location", { - get: $util.oneOfGetter($oneOfFields = ["locationId", "postCodeRange"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * TaxRule rateCalculation. - * @member {"useGoogleRate"|"selfSpecifiedRateMicros"|undefined} rateCalculation - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - */ - Object.defineProperty(TaxRule.prototype, "rateCalculation", { - get: $util.oneOfGetter($oneOfFields = ["useGoogleRate", "selfSpecifiedRateMicros"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TaxRule instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITaxRule=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.TaxRule} TaxRule instance - */ - TaxRule.create = function create(properties) { - return new TaxRule(properties); - }; - - /** - * Encodes the specified TaxRule message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITaxRule} message TaxRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaxRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); - if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.locationId); - if (message.postCodeRange != null && Object.hasOwnProperty.call(message, "postCodeRange")) - $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.encode(message.postCodeRange, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.useGoogleRate != null && Object.hasOwnProperty.call(message, "useGoogleRate")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.useGoogleRate); - if (message.selfSpecifiedRateMicros != null && Object.hasOwnProperty.call(message, "selfSpecifiedRateMicros")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.selfSpecifiedRateMicros); - if (message.shippingTaxed != null && Object.hasOwnProperty.call(message, "shippingTaxed")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.shippingTaxed); - if (message.effectiveTimePeriod != null && Object.hasOwnProperty.call(message, "effectiveTimePeriod")) - $root.google.type.Interval.encode(message.effectiveTimePeriod, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaxRule message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITaxRule} message TaxRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaxRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaxRule message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @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.TaxRule} TaxRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaxRule.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.TaxRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.locationId = reader.int64(); - break; - } - case 3: { - message.postCodeRange = $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.decode(reader, reader.uint32()); - break; - } - case 4: { - message.useGoogleRate = reader.bool(); - break; - } - case 5: { - message.selfSpecifiedRateMicros = reader.int64(); - break; - } - case 1: { - message.regionCode = reader.string(); - break; - } - case 6: { - message.shippingTaxed = reader.bool(); - break; - } - case 7: { - message.effectiveTimePeriod = $root.google.type.Interval.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaxRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.TaxRule} TaxRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaxRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaxRule message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaxRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.locationId != null && message.hasOwnProperty("locationId")) { - properties.location = 1; - if (!$util.isInteger(message.locationId) && !(message.locationId && $util.isInteger(message.locationId.low) && $util.isInteger(message.locationId.high))) - return "locationId: integer|Long expected"; - } - if (message.postCodeRange != null && message.hasOwnProperty("postCodeRange")) { - if (properties.location === 1) - return "location: multiple values"; - properties.location = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify(message.postCodeRange); - if (error) - return "postCodeRange." + error; - } - } - if (message.useGoogleRate != null && message.hasOwnProperty("useGoogleRate")) { - properties.rateCalculation = 1; - if (typeof message.useGoogleRate !== "boolean") - return "useGoogleRate: boolean expected"; - } - if (message.selfSpecifiedRateMicros != null && message.hasOwnProperty("selfSpecifiedRateMicros")) { - if (properties.rateCalculation === 1) - return "rateCalculation: multiple values"; - properties.rateCalculation = 1; - if (!$util.isInteger(message.selfSpecifiedRateMicros) && !(message.selfSpecifiedRateMicros && $util.isInteger(message.selfSpecifiedRateMicros.low) && $util.isInteger(message.selfSpecifiedRateMicros.high))) - return "selfSpecifiedRateMicros: integer|Long expected"; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.shippingTaxed != null && message.hasOwnProperty("shippingTaxed")) - if (typeof message.shippingTaxed !== "boolean") - return "shippingTaxed: boolean expected"; - if (message.effectiveTimePeriod != null && message.hasOwnProperty("effectiveTimePeriod")) { - var error = $root.google.type.Interval.verify(message.effectiveTimePeriod); - if (error) - return "effectiveTimePeriod." + error; - } - return null; - }; - - /** - * Creates a TaxRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.TaxRule} TaxRule - */ - TaxRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TaxRule) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.TaxRule(); - if (object.locationId != null) - if ($util.Long) - (message.locationId = $util.Long.fromValue(object.locationId)).unsigned = false; - else if (typeof object.locationId === "string") - message.locationId = parseInt(object.locationId, 10); - else if (typeof object.locationId === "number") - message.locationId = object.locationId; - else if (typeof object.locationId === "object") - message.locationId = new $util.LongBits(object.locationId.low >>> 0, object.locationId.high >>> 0).toNumber(); - if (object.postCodeRange != null) { - if (typeof object.postCodeRange !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.TaxRule.postCodeRange: object expected"); - message.postCodeRange = $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.fromObject(object.postCodeRange); - } - if (object.useGoogleRate != null) - message.useGoogleRate = Boolean(object.useGoogleRate); - if (object.selfSpecifiedRateMicros != null) - if ($util.Long) - (message.selfSpecifiedRateMicros = $util.Long.fromValue(object.selfSpecifiedRateMicros)).unsigned = false; - else if (typeof object.selfSpecifiedRateMicros === "string") - message.selfSpecifiedRateMicros = parseInt(object.selfSpecifiedRateMicros, 10); - else if (typeof object.selfSpecifiedRateMicros === "number") - message.selfSpecifiedRateMicros = object.selfSpecifiedRateMicros; - else if (typeof object.selfSpecifiedRateMicros === "object") - message.selfSpecifiedRateMicros = new $util.LongBits(object.selfSpecifiedRateMicros.low >>> 0, object.selfSpecifiedRateMicros.high >>> 0).toNumber(); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - if (object.shippingTaxed != null) - message.shippingTaxed = Boolean(object.shippingTaxed); - if (object.effectiveTimePeriod != null) { - if (typeof object.effectiveTimePeriod !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.TaxRule.effectiveTimePeriod: object expected"); - message.effectiveTimePeriod = $root.google.type.Interval.fromObject(object.effectiveTimePeriod); - } - return message; - }; - - /** - * Creates a plain object from a TaxRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @static - * @param {google.shopping.merchant.accounts.v1beta.TaxRule} message TaxRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaxRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.regionCode = ""; - object.shippingTaxed = false; - object.effectiveTimePeriod = null; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.locationId != null && message.hasOwnProperty("locationId")) { - if (typeof message.locationId === "number") - object.locationId = options.longs === String ? String(message.locationId) : message.locationId; - else - object.locationId = options.longs === String ? $util.Long.prototype.toString.call(message.locationId) : options.longs === Number ? new $util.LongBits(message.locationId.low >>> 0, message.locationId.high >>> 0).toNumber() : message.locationId; - if (options.oneofs) - object.location = "locationId"; - } - if (message.postCodeRange != null && message.hasOwnProperty("postCodeRange")) { - object.postCodeRange = $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.toObject(message.postCodeRange, options); - if (options.oneofs) - object.location = "postCodeRange"; - } - if (message.useGoogleRate != null && message.hasOwnProperty("useGoogleRate")) { - object.useGoogleRate = message.useGoogleRate; - if (options.oneofs) - object.rateCalculation = "useGoogleRate"; - } - if (message.selfSpecifiedRateMicros != null && message.hasOwnProperty("selfSpecifiedRateMicros")) { - if (typeof message.selfSpecifiedRateMicros === "number") - object.selfSpecifiedRateMicros = options.longs === String ? String(message.selfSpecifiedRateMicros) : message.selfSpecifiedRateMicros; - else - object.selfSpecifiedRateMicros = options.longs === String ? $util.Long.prototype.toString.call(message.selfSpecifiedRateMicros) : options.longs === Number ? new $util.LongBits(message.selfSpecifiedRateMicros.low >>> 0, message.selfSpecifiedRateMicros.high >>> 0).toNumber() : message.selfSpecifiedRateMicros; - if (options.oneofs) - object.rateCalculation = "selfSpecifiedRateMicros"; - } - if (message.shippingTaxed != null && message.hasOwnProperty("shippingTaxed")) - object.shippingTaxed = message.shippingTaxed; - if (message.effectiveTimePeriod != null && message.hasOwnProperty("effectiveTimePeriod")) - object.effectiveTimePeriod = $root.google.type.Interval.toObject(message.effectiveTimePeriod, options); - return object; - }; - - /** - * Converts this TaxRule to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @instance - * @returns {Object.} JSON object - */ - TaxRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaxRule - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaxRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TaxRule"; - }; - - TaxRule.TaxPostalCodeRange = (function() { - - /** - * Properties of a TaxPostalCodeRange. - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @interface ITaxPostalCodeRange - * @property {string|null} [start] TaxPostalCodeRange start - * @property {string|null} [end] TaxPostalCodeRange end - */ - - /** - * Constructs a new TaxPostalCodeRange. - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule - * @classdesc Represents a TaxPostalCodeRange. - * @implements ITaxPostalCodeRange - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange=} [properties] Properties to set - */ - function TaxPostalCodeRange(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]]; - } - - /** - * TaxPostalCodeRange start. - * @member {string} start - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @instance - */ - TaxPostalCodeRange.prototype.start = ""; - - /** - * TaxPostalCodeRange end. - * @member {string} end - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @instance - */ - TaxPostalCodeRange.prototype.end = ""; - - /** - * Creates a new TaxPostalCodeRange instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @static - * @param {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange} TaxPostalCodeRange instance - */ - TaxPostalCodeRange.create = function create(properties) { - return new TaxPostalCodeRange(properties); - }; - - /** - * Encodes the specified TaxPostalCodeRange message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @static - * @param {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange} message TaxPostalCodeRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaxPostalCodeRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.end); - return writer; - }; - - /** - * Encodes the specified TaxPostalCodeRange message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @static - * @param {google.shopping.merchant.accounts.v1beta.TaxRule.ITaxPostalCodeRange} message TaxPostalCodeRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaxPostalCodeRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaxPostalCodeRange message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @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.TaxRule.TaxPostalCodeRange} TaxPostalCodeRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaxPostalCodeRange.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.TaxRule.TaxPostalCodeRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.string(); - break; - } - case 2: { - message.end = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaxPostalCodeRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange} TaxPostalCodeRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaxPostalCodeRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaxPostalCodeRange message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaxPostalCodeRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isString(message.start)) - return "start: string expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isString(message.end)) - return "end: string expected"; - return null; - }; - - /** - * Creates a TaxPostalCodeRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange} TaxPostalCodeRange - */ - TaxPostalCodeRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange(); - if (object.start != null) - message.start = String(object.start); - if (object.end != null) - message.end = String(object.end); - return message; - }; - - /** - * Creates a plain object from a TaxPostalCodeRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @static - * @param {google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange} message TaxPostalCodeRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaxPostalCodeRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = ""; - object.end = ""; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this TaxPostalCodeRange to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @instance - * @returns {Object.} JSON object - */ - TaxPostalCodeRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaxPostalCodeRange - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaxPostalCodeRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TaxRule.TaxPostalCodeRange"; - }; - - return TaxPostalCodeRange; - })(); - - return TaxRule; - })(); - - v1beta.AccountIssueService = (function() { - - /** - * Constructs a new AccountIssueService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an AccountIssueService - * @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 AccountIssueService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AccountIssueService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AccountIssueService; - - /** - * Creates new AccountIssueService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssueService - * @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 {AccountIssueService} RPC service. Useful where requests and/or responses are streamed. - */ - AccountIssueService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountIssueService|listAccountIssues}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssueService - * @typedef ListAccountIssuesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} [response] ListAccountIssuesResponse - */ - - /** - * Calls ListAccountIssues. - * @function listAccountIssues - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssueService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest} request ListAccountIssuesRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountIssueService.ListAccountIssuesCallback} callback Node-style callback called with the error, if any, and ListAccountIssuesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountIssueService.prototype.listAccountIssues = function listAccountIssues(request, callback) { - return this.rpcCall(listAccountIssues, $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest, $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse, request, callback); - }, "name", { value: "ListAccountIssues" }); - - /** - * Calls ListAccountIssues. - * @function listAccountIssues - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssueService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest} request ListAccountIssuesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AccountIssueService; - })(); - - v1beta.AccountIssue = (function() { - - /** - * Properties of an AccountIssue. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IAccountIssue - * @property {string|null} [name] AccountIssue name - * @property {string|null} [title] AccountIssue title - * @property {google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|null} [severity] AccountIssue severity - * @property {Array.|null} [impactedDestinations] AccountIssue impactedDestinations - * @property {string|null} [detail] AccountIssue detail - * @property {string|null} [documentationUri] AccountIssue documentationUri - */ - - /** - * Constructs a new AccountIssue. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an AccountIssue. - * @implements IAccountIssue - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IAccountIssue=} [properties] Properties to set - */ - function AccountIssue(properties) { - this.impactedDestinations = []; - 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]]; - } - - /** - * AccountIssue name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @instance - */ - AccountIssue.prototype.name = ""; - - /** - * AccountIssue title. - * @member {string} title - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @instance - */ - AccountIssue.prototype.title = ""; - - /** - * AccountIssue severity. - * @member {google.shopping.merchant.accounts.v1beta.AccountIssue.Severity} severity - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @instance - */ - AccountIssue.prototype.severity = 0; - - /** - * AccountIssue impactedDestinations. - * @member {Array.} impactedDestinations - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @instance - */ - AccountIssue.prototype.impactedDestinations = $util.emptyArray; - - /** - * AccountIssue detail. - * @member {string} detail - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @instance - */ - AccountIssue.prototype.detail = ""; - - /** - * AccountIssue documentationUri. - * @member {string} documentationUri - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @instance - */ - AccountIssue.prototype.documentationUri = ""; - - /** - * Creates a new AccountIssue instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccountIssue=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue} AccountIssue instance - */ - AccountIssue.create = function create(properties) { - return new AccountIssue(properties); - }; - - /** - * Encodes the specified AccountIssue message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccountIssue} message AccountIssue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccountIssue.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.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.severity); - if (message.impactedDestinations != null && message.impactedDestinations.length) - for (var i = 0; i < message.impactedDestinations.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.encode(message.impactedDestinations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.detail); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentationUri); - return writer; - }; - - /** - * Encodes the specified AccountIssue message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccountIssue} message AccountIssue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccountIssue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccountIssue message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @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.AccountIssue} AccountIssue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccountIssue.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.AccountIssue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.severity = reader.int32(); - break; - } - case 4: { - if (!(message.impactedDestinations && message.impactedDestinations.length)) - message.impactedDestinations = []; - message.impactedDestinations.push($root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.decode(reader, reader.uint32())); - break; - } - case 5: { - message.detail = reader.string(); - break; - } - case 6: { - message.documentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccountIssue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue} AccountIssue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccountIssue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccountIssue message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccountIssue.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.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.impactedDestinations != null && message.hasOwnProperty("impactedDestinations")) { - if (!Array.isArray(message.impactedDestinations)) - return "impactedDestinations: array expected"; - for (var i = 0; i < message.impactedDestinations.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify(message.impactedDestinations[i]); - if (error) - return "impactedDestinations." + error; - } - } - if (message.detail != null && message.hasOwnProperty("detail")) - if (!$util.isString(message.detail)) - return "detail: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - return null; - }; - - /** - * Creates an AccountIssue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue} AccountIssue - */ - AccountIssue.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AccountIssue) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.AccountIssue(); - if (object.name != null) - message.name = String(object.name); - if (object.title != null) - message.title = String(object.title); - switch (object.severity) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; - } - break; - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "CRITICAL": - case 1: - message.severity = 1; - break; - case "ERROR": - case 2: - message.severity = 2; - break; - case "SUGGESTION": - case 3: - message.severity = 3; - break; - } - if (object.impactedDestinations) { - if (!Array.isArray(object.impactedDestinations)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountIssue.impactedDestinations: array expected"); - message.impactedDestinations = []; - for (var i = 0; i < object.impactedDestinations.length; ++i) { - if (typeof object.impactedDestinations[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountIssue.impactedDestinations: object expected"); - message.impactedDestinations[i] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.fromObject(object.impactedDestinations[i]); - } - } - if (object.detail != null) - message.detail = String(object.detail); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - return message; - }; - - /** - * Creates a plain object from an AccountIssue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue} message AccountIssue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccountIssue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.impactedDestinations = []; - if (options.defaults) { - object.name = ""; - object.title = ""; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - object.detail = ""; - object.documentationUri = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.AccountIssue.Severity[message.severity] === undefined ? message.severity : $root.google.shopping.merchant.accounts.v1beta.AccountIssue.Severity[message.severity] : message.severity; - if (message.impactedDestinations && message.impactedDestinations.length) { - object.impactedDestinations = []; - for (var j = 0; j < message.impactedDestinations.length; ++j) - object.impactedDestinations[j] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.toObject(message.impactedDestinations[j], options); - } - if (message.detail != null && message.hasOwnProperty("detail")) - object.detail = message.detail; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - return object; - }; - - /** - * Converts this AccountIssue to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @instance - * @returns {Object.} JSON object - */ - AccountIssue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AccountIssue - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AccountIssue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AccountIssue"; - }; - - AccountIssue.ImpactedDestination = (function() { - - /** - * Properties of an ImpactedDestination. - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @interface IImpactedDestination - * @property {google.shopping.type.ReportingContext.ReportingContextEnum|null} [reportingContext] ImpactedDestination reportingContext - * @property {Array.|null} [impacts] ImpactedDestination impacts - */ - - /** - * Constructs a new ImpactedDestination. - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue - * @classdesc Represents an ImpactedDestination. - * @implements IImpactedDestination - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination=} [properties] Properties to set - */ - function ImpactedDestination(properties) { - this.impacts = []; - 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]]; - } - - /** - * ImpactedDestination reportingContext. - * @member {google.shopping.type.ReportingContext.ReportingContextEnum|null|undefined} reportingContext - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @instance - */ - ImpactedDestination.prototype.reportingContext = null; - - /** - * ImpactedDestination impacts. - * @member {Array.} impacts - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @instance - */ - ImpactedDestination.prototype.impacts = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImpactedDestination _reportingContext. - * @member {"reportingContext"|undefined} _reportingContext - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @instance - */ - Object.defineProperty(ImpactedDestination.prototype, "_reportingContext", { - get: $util.oneOfGetter($oneOfFields = ["reportingContext"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ImpactedDestination instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination} ImpactedDestination instance - */ - ImpactedDestination.create = function create(properties) { - return new ImpactedDestination(properties); - }; - - /** - * Encodes the specified ImpactedDestination message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination} message ImpactedDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImpactedDestination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.reportingContext != null && Object.hasOwnProperty.call(message, "reportingContext")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reportingContext); - if (message.impacts != null && message.impacts.length) - for (var i = 0; i < message.impacts.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.encode(message.impacts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImpactedDestination message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.IImpactedDestination} message ImpactedDestination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImpactedDestination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImpactedDestination message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @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.AccountIssue.ImpactedDestination} ImpactedDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImpactedDestination.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.AccountIssue.ImpactedDestination(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.reportingContext = reader.int32(); - break; - } - case 2: { - if (!(message.impacts && message.impacts.length)) - message.impacts = []; - message.impacts.push($root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImpactedDestination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination} ImpactedDestination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImpactedDestination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImpactedDestination message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImpactedDestination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.reportingContext != null && message.hasOwnProperty("reportingContext")) { - properties._reportingContext = 1; - switch (message.reportingContext) { - default: - return "reportingContext: enum value expected"; - case 0: - case 1: - case 2: - case 13: - case 14: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - break; - } - } - if (message.impacts != null && message.hasOwnProperty("impacts")) { - if (!Array.isArray(message.impacts)) - return "impacts: array expected"; - for (var i = 0; i < message.impacts.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify(message.impacts[i]); - if (error) - return "impacts." + error; - } - } - return null; - }; - - /** - * Creates an ImpactedDestination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination} ImpactedDestination - */ - ImpactedDestination.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination(); - switch (object.reportingContext) { - default: - if (typeof object.reportingContext === "number") { - message.reportingContext = object.reportingContext; - break; - } - break; - case "REPORTING_CONTEXT_ENUM_UNSPECIFIED": - case 0: - message.reportingContext = 0; - break; - case "SHOPPING_ADS": - case 1: - message.reportingContext = 1; - break; - case "DISCOVERY_ADS": - case 2: - message.reportingContext = 2; - break; - case "DEMAND_GEN_ADS": - case 13: - message.reportingContext = 13; - break; - case "DEMAND_GEN_ADS_DISCOVER_SURFACE": - case 14: - message.reportingContext = 14; - break; - case "VIDEO_ADS": - case 3: - message.reportingContext = 3; - break; - case "DISPLAY_ADS": - case 4: - message.reportingContext = 4; - break; - case "LOCAL_INVENTORY_ADS": - case 5: - message.reportingContext = 5; - break; - case "VEHICLE_INVENTORY_ADS": - case 6: - message.reportingContext = 6; - break; - case "FREE_LISTINGS": - case 7: - message.reportingContext = 7; - break; - case "FREE_LOCAL_LISTINGS": - case 8: - message.reportingContext = 8; - break; - case "FREE_LOCAL_VEHICLE_LISTINGS": - case 9: - message.reportingContext = 9; - break; - case "YOUTUBE_SHOPPING": - case 10: - message.reportingContext = 10; - break; - case "CLOUD_RETAIL": - case 11: - message.reportingContext = 11; - break; - case "LOCAL_CLOUD_RETAIL": - case 12: - message.reportingContext = 12; - break; - } - if (object.impacts) { - if (!Array.isArray(object.impacts)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.impacts: array expected"); - message.impacts = []; - for (var i = 0; i < object.impacts.length; ++i) { - if (typeof object.impacts[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.impacts: object expected"); - message.impacts[i] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.fromObject(object.impacts[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ImpactedDestination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination} message ImpactedDestination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImpactedDestination.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.impacts = []; - if (message.reportingContext != null && message.hasOwnProperty("reportingContext")) { - object.reportingContext = options.enums === String ? $root.google.shopping.type.ReportingContext.ReportingContextEnum[message.reportingContext] === undefined ? message.reportingContext : $root.google.shopping.type.ReportingContext.ReportingContextEnum[message.reportingContext] : message.reportingContext; - if (options.oneofs) - object._reportingContext = "reportingContext"; - } - if (message.impacts && message.impacts.length) { - object.impacts = []; - for (var j = 0; j < message.impacts.length; ++j) - object.impacts[j] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.toObject(message.impacts[j], options); - } - return object; - }; - - /** - * Converts this ImpactedDestination to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @instance - * @returns {Object.} JSON object - */ - ImpactedDestination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImpactedDestination - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImpactedDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination"; - }; - - ImpactedDestination.Impact = (function() { - - /** - * Properties of an Impact. - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @interface IImpact - * @property {string|null} [regionCode] Impact regionCode - * @property {google.shopping.merchant.accounts.v1beta.AccountIssue.Severity|null} [severity] Impact severity - */ - - /** - * Constructs a new Impact. - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination - * @classdesc Represents an Impact. - * @implements IImpact - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact=} [properties] Properties to set - */ - function Impact(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]]; - } - - /** - * Impact regionCode. - * @member {string} regionCode - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @instance - */ - Impact.prototype.regionCode = ""; - - /** - * Impact severity. - * @member {google.shopping.merchant.accounts.v1beta.AccountIssue.Severity} severity - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @instance - */ - Impact.prototype.severity = 0; - - /** - * Creates a new Impact instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact} Impact instance - */ - Impact.create = function create(properties) { - return new Impact(properties); - }; - - /** - * Encodes the specified Impact message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact} message Impact message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Impact.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.severity); - return writer; - }; - - /** - * Encodes the specified Impact message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.IImpact} message Impact message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Impact.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Impact message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @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.AccountIssue.ImpactedDestination.Impact} Impact - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Impact.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.AccountIssue.ImpactedDestination.Impact(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.regionCode = reader.string(); - break; - } - case 2: { - message.severity = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Impact message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact} Impact - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Impact.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Impact message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Impact.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an Impact message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact} Impact - */ - Impact.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact(); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - switch (object.severity) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; - } - break; - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "CRITICAL": - case 1: - message.severity = 1; - break; - case "ERROR": - case 2: - message.severity = 2; - break; - case "SUGGESTION": - case 3: - message.severity = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an Impact message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @static - * @param {google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact} message Impact - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Impact.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.regionCode = ""; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.AccountIssue.Severity[message.severity] === undefined ? message.severity : $root.google.shopping.merchant.accounts.v1beta.AccountIssue.Severity[message.severity] : message.severity; - return object; - }; - - /** - * Converts this Impact to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @instance - * @returns {Object.} JSON object - */ - Impact.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Impact - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Impact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AccountIssue.ImpactedDestination.Impact"; - }; - - return Impact; - })(); - - return ImpactedDestination; - })(); - - /** - * Severity enum. - * @name google.shopping.merchant.accounts.v1beta.AccountIssue.Severity - * @enum {number} - * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value - * @property {number} CRITICAL=1 CRITICAL value - * @property {number} ERROR=2 ERROR value - * @property {number} SUGGESTION=3 SUGGESTION value - */ - AccountIssue.Severity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "CRITICAL"] = 1; - values[valuesById[2] = "ERROR"] = 2; - values[valuesById[3] = "SUGGESTION"] = 3; - return values; - })(); - - return AccountIssue; - })(); - - v1beta.ListAccountIssuesRequest = (function() { - - /** - * Properties of a ListAccountIssuesRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListAccountIssuesRequest - * @property {string|null} [parent] ListAccountIssuesRequest parent - * @property {number|null} [pageSize] ListAccountIssuesRequest pageSize - * @property {string|null} [pageToken] ListAccountIssuesRequest pageToken - * @property {string|null} [languageCode] ListAccountIssuesRequest languageCode - * @property {string|null} [timeZone] ListAccountIssuesRequest timeZone - */ - - /** - * Constructs a new ListAccountIssuesRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListAccountIssuesRequest. - * @implements IListAccountIssuesRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest=} [properties] Properties to set - */ - function ListAccountIssuesRequest(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]]; - } - - /** - * ListAccountIssuesRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @instance - */ - ListAccountIssuesRequest.prototype.parent = ""; - - /** - * ListAccountIssuesRequest pageSize. - * @member {number} pageSize - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @instance - */ - ListAccountIssuesRequest.prototype.pageSize = 0; - - /** - * ListAccountIssuesRequest pageToken. - * @member {string} pageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @instance - */ - ListAccountIssuesRequest.prototype.pageToken = ""; - - /** - * ListAccountIssuesRequest languageCode. - * @member {string} languageCode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @instance - */ - ListAccountIssuesRequest.prototype.languageCode = ""; - - /** - * ListAccountIssuesRequest timeZone. - * @member {string} timeZone - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @instance - */ - ListAccountIssuesRequest.prototype.timeZone = ""; - - /** - * Creates a new ListAccountIssuesRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest} ListAccountIssuesRequest instance - */ - ListAccountIssuesRequest.create = function create(properties) { - return new ListAccountIssuesRequest(properties); - }; - - /** - * Encodes the specified ListAccountIssuesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest} message ListAccountIssuesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountIssuesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.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")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); - return writer; - }; - - /** - * Encodes the specified ListAccountIssuesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest} message ListAccountIssuesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountIssuesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAccountIssuesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @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.ListAccountIssuesRequest} ListAccountIssuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountIssuesRequest.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.ListAccountIssuesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.languageCode = reader.string(); - break; - } - case 5: { - message.timeZone = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAccountIssuesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest} ListAccountIssuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountIssuesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAccountIssuesRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAccountIssuesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - return null; - }; - - /** - * Creates a ListAccountIssuesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest} ListAccountIssuesRequest - */ - ListAccountIssuesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - return message; - }; - - /** - * Creates a plain object from a ListAccountIssuesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest} message ListAccountIssuesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAccountIssuesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.languageCode = ""; - object.timeZone = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - return object; - }; - - /** - * Converts this ListAccountIssuesRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @instance - * @returns {Object.} JSON object - */ - ListAccountIssuesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAccountIssuesRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAccountIssuesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest"; - }; - - return ListAccountIssuesRequest; - })(); - - v1beta.ListAccountIssuesResponse = (function() { - - /** - * Properties of a ListAccountIssuesResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListAccountIssuesResponse - * @property {Array.|null} [accountIssues] ListAccountIssuesResponse accountIssues - * @property {string|null} [nextPageToken] ListAccountIssuesResponse nextPageToken - */ - - /** - * Constructs a new ListAccountIssuesResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListAccountIssuesResponse. - * @implements IListAccountIssuesResponse - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse=} [properties] Properties to set - */ - function ListAccountIssuesResponse(properties) { - this.accountIssues = []; - 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]]; - } - - /** - * ListAccountIssuesResponse accountIssues. - * @member {Array.} accountIssues - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @instance - */ - ListAccountIssuesResponse.prototype.accountIssues = $util.emptyArray; - - /** - * ListAccountIssuesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @instance - */ - ListAccountIssuesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAccountIssuesResponse instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} ListAccountIssuesResponse instance - */ - ListAccountIssuesResponse.create = function create(properties) { - return new ListAccountIssuesResponse(properties); - }; - - /** - * Encodes the specified ListAccountIssuesResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse} message ListAccountIssuesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountIssuesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.accountIssues != null && message.accountIssues.length) - for (var i = 0; i < message.accountIssues.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.AccountIssue.encode(message.accountIssues[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListAccountIssuesResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse} message ListAccountIssuesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountIssuesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAccountIssuesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @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.ListAccountIssuesResponse} ListAccountIssuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountIssuesResponse.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.ListAccountIssuesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.accountIssues && message.accountIssues.length)) - message.accountIssues = []; - message.accountIssues.push($root.google.shopping.merchant.accounts.v1beta.AccountIssue.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAccountIssuesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} ListAccountIssuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountIssuesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAccountIssuesResponse message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAccountIssuesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.accountIssues != null && message.hasOwnProperty("accountIssues")) { - if (!Array.isArray(message.accountIssues)) - return "accountIssues: array expected"; - for (var i = 0; i < message.accountIssues.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.verify(message.accountIssues[i]); - if (error) - return "accountIssues." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAccountIssuesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} ListAccountIssuesResponse - */ - ListAccountIssuesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse(); - if (object.accountIssues) { - if (!Array.isArray(object.accountIssues)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.accountIssues: array expected"); - message.accountIssues = []; - for (var i = 0; i < object.accountIssues.length; ++i) { - if (typeof object.accountIssues[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse.accountIssues: object expected"); - message.accountIssues[i] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.fromObject(object.accountIssues[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAccountIssuesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse} message ListAccountIssuesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAccountIssuesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.accountIssues = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.accountIssues && message.accountIssues.length) { - object.accountIssues = []; - for (var j = 0; j < message.accountIssues.length; ++j) - object.accountIssues[j] = $root.google.shopping.merchant.accounts.v1beta.AccountIssue.toObject(message.accountIssues[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAccountIssuesResponse to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @instance - * @returns {Object.} JSON object - */ - ListAccountIssuesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAccountIssuesResponse - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAccountIssuesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse"; - }; - - return ListAccountIssuesResponse; - })(); - - v1beta.AccountsService = (function() { - - /** - * Constructs a new AccountsService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an AccountsService - * @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 AccountsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AccountsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AccountsService; - - /** - * Creates new AccountsService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @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 {AccountsService} RPC service. Useful where requests and/or responses are streamed. - */ - AccountsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|getAccount}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @typedef GetAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Account} [response] Account - */ - - /** - * Calls GetAccount. - * @function getAccount - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest} request GetAccountRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountsService.GetAccountCallback} callback Node-style callback called with the error, if any, and Account - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountsService.prototype.getAccount = function getAccount(request, callback) { - return this.rpcCall(getAccount, $root.google.shopping.merchant.accounts.v1beta.GetAccountRequest, $root.google.shopping.merchant.accounts.v1beta.Account, request, callback); - }, "name", { value: "GetAccount" }); - - /** - * Calls GetAccount. - * @function getAccount - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest} request GetAccountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|createAndConfigureAccount}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @typedef CreateAndConfigureAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Account} [response] Account - */ - - /** - * Calls CreateAndConfigureAccount. - * @function createAndConfigureAccount - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest} request CreateAndConfigureAccountRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountsService.CreateAndConfigureAccountCallback} callback Node-style callback called with the error, if any, and Account - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountsService.prototype.createAndConfigureAccount = function createAndConfigureAccount(request, callback) { - return this.rpcCall(createAndConfigureAccount, $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest, $root.google.shopping.merchant.accounts.v1beta.Account, request, callback); - }, "name", { value: "CreateAndConfigureAccount" }); - - /** - * Calls CreateAndConfigureAccount. - * @function createAndConfigureAccount - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest} request CreateAndConfigureAccountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|deleteAccount}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @typedef DeleteAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteAccount. - * @function deleteAccount - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest} request DeleteAccountRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountsService.DeleteAccountCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountsService.prototype.deleteAccount = function deleteAccount(request, callback) { - return this.rpcCall(deleteAccount, $root.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAccount" }); - - /** - * Calls DeleteAccount. - * @function deleteAccount - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest} request DeleteAccountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|updateAccount}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @typedef UpdateAccountCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Account} [response] Account - */ - - /** - * Calls UpdateAccount. - * @function updateAccount - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest} request UpdateAccountRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountsService.UpdateAccountCallback} callback Node-style callback called with the error, if any, and Account - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountsService.prototype.updateAccount = function updateAccount(request, callback) { - return this.rpcCall(updateAccount, $root.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest, $root.google.shopping.merchant.accounts.v1beta.Account, request, callback); - }, "name", { value: "UpdateAccount" }); - - /** - * Calls UpdateAccount. - * @function updateAccount - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest} request UpdateAccountRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|listAccounts}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @typedef ListAccountsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} [response] ListAccountsResponse - */ - - /** - * Calls ListAccounts. - * @function listAccounts - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest} request ListAccountsRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountsService.ListAccountsCallback} callback Node-style callback called with the error, if any, and ListAccountsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountsService.prototype.listAccounts = function listAccounts(request, callback) { - return this.rpcCall(listAccounts, $root.google.shopping.merchant.accounts.v1beta.ListAccountsRequest, $root.google.shopping.merchant.accounts.v1beta.ListAccountsResponse, request, callback); - }, "name", { value: "ListAccounts" }); - - /** - * Calls ListAccounts. - * @function listAccounts - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest} request ListAccountsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.AccountsService|listSubAccounts}. - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @typedef ListSubAccountsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} [response] ListSubAccountsResponse - */ - - /** - * Calls ListSubAccounts. - * @function listSubAccounts - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest} request ListSubAccountsRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.AccountsService.ListSubAccountsCallback} callback Node-style callback called with the error, if any, and ListSubAccountsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AccountsService.prototype.listSubAccounts = function listSubAccounts(request, callback) { - return this.rpcCall(listSubAccounts, $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest, $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse, request, callback); - }, "name", { value: "ListSubAccounts" }); - - /** - * Calls ListSubAccounts. - * @function listSubAccounts - * @memberof google.shopping.merchant.accounts.v1beta.AccountsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest} request ListSubAccountsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AccountsService; - })(); - - v1beta.Account = (function() { - - /** - * Properties of an Account. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IAccount - * @property {string|null} [name] Account name - * @property {number|Long|null} [accountId] Account accountId - * @property {string|null} [accountName] Account accountName - * @property {boolean|null} [adultContent] Account adultContent - * @property {boolean|null} [testAccount] Account testAccount - * @property {google.type.ITimeZone|null} [timeZone] Account timeZone - * @property {string|null} [languageCode] Account languageCode - */ - - /** - * Constructs a new Account. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an Account. - * @implements IAccount - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IAccount=} [properties] Properties to set - */ - function Account(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]]; - } - - /** - * Account name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @instance - */ - Account.prototype.name = ""; - - /** - * Account accountId. - * @member {number|Long} accountId - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @instance - */ - Account.prototype.accountId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Account accountName. - * @member {string} accountName - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @instance - */ - Account.prototype.accountName = ""; - - /** - * Account adultContent. - * @member {boolean} adultContent - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @instance - */ - Account.prototype.adultContent = false; - - /** - * Account testAccount. - * @member {boolean} testAccount - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @instance - */ - Account.prototype.testAccount = false; - - /** - * Account timeZone. - * @member {google.type.ITimeZone|null|undefined} timeZone - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @instance - */ - Account.prototype.timeZone = null; - - /** - * Account languageCode. - * @member {string} languageCode - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @instance - */ - Account.prototype.languageCode = ""; - - /** - * Creates a new Account instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccount=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Account} Account instance - */ - Account.create = function create(properties) { - return new Account(properties); - }; - - /** - * Encodes the specified Account message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Account.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccount} message Account message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Account.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.accountId != null && Object.hasOwnProperty.call(message, "accountId")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.accountId); - if (message.accountName != null && Object.hasOwnProperty.call(message, "accountName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.accountName); - if (message.adultContent != null && Object.hasOwnProperty.call(message, "adultContent")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.adultContent); - if (message.testAccount != null && Object.hasOwnProperty.call(message, "testAccount")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.testAccount); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.languageCode); - return writer; - }; - - /** - * Encodes the specified Account message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Account.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccount} message Account message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Account.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Account message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @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.Account} Account - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Account.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.Account(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.accountId = reader.int64(); - break; - } - case 3: { - message.accountName = reader.string(); - break; - } - case 4: { - message.adultContent = reader.bool(); - break; - } - case 5: { - message.testAccount = reader.bool(); - break; - } - case 6: { - message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); - break; - } - case 7: { - message.languageCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Account message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Account} Account - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Account.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Account message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Account.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.accountId != null && message.hasOwnProperty("accountId")) - if (!$util.isInteger(message.accountId) && !(message.accountId && $util.isInteger(message.accountId.low) && $util.isInteger(message.accountId.high))) - return "accountId: integer|Long expected"; - if (message.accountName != null && message.hasOwnProperty("accountName")) - if (!$util.isString(message.accountName)) - return "accountName: string expected"; - if (message.adultContent != null && message.hasOwnProperty("adultContent")) - if (typeof message.adultContent !== "boolean") - return "adultContent: boolean expected"; - if (message.testAccount != null && message.hasOwnProperty("testAccount")) - if (typeof message.testAccount !== "boolean") - return "testAccount: boolean expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) { - var error = $root.google.type.TimeZone.verify(message.timeZone); - if (error) - return "timeZone." + error; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - return null; - }; - - /** - * Creates an Account message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Account} Account - */ - Account.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Account) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Account(); - if (object.name != null) - message.name = String(object.name); - if (object.accountId != null) - if ($util.Long) - (message.accountId = $util.Long.fromValue(object.accountId)).unsigned = false; - else if (typeof object.accountId === "string") - message.accountId = parseInt(object.accountId, 10); - else if (typeof object.accountId === "number") - message.accountId = object.accountId; - else if (typeof object.accountId === "object") - message.accountId = new $util.LongBits(object.accountId.low >>> 0, object.accountId.high >>> 0).toNumber(); - if (object.accountName != null) - message.accountName = String(object.accountName); - if (object.adultContent != null) - message.adultContent = Boolean(object.adultContent); - if (object.testAccount != null) - message.testAccount = Boolean(object.testAccount); - if (object.timeZone != null) { - if (typeof object.timeZone !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Account.timeZone: object expected"); - message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - return message; - }; - - /** - * Creates a plain object from an Account message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @static - * @param {google.shopping.merchant.accounts.v1beta.Account} message Account - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Account.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.accountId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.accountId = options.longs === String ? "0" : 0; - object.accountName = ""; - object.adultContent = false; - object.testAccount = false; - object.timeZone = null; - object.languageCode = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.accountId != null && message.hasOwnProperty("accountId")) - if (typeof message.accountId === "number") - object.accountId = options.longs === String ? String(message.accountId) : message.accountId; - else - object.accountId = options.longs === String ? $util.Long.prototype.toString.call(message.accountId) : options.longs === Number ? new $util.LongBits(message.accountId.low >>> 0, message.accountId.high >>> 0).toNumber() : message.accountId; - if (message.accountName != null && message.hasOwnProperty("accountName")) - object.accountName = message.accountName; - if (message.adultContent != null && message.hasOwnProperty("adultContent")) - object.adultContent = message.adultContent; - if (message.testAccount != null && message.hasOwnProperty("testAccount")) - object.testAccount = message.testAccount; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; - - /** - * Converts this Account to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @instance - * @returns {Object.} JSON object - */ - Account.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Account - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Account - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Account.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Account"; - }; - - return Account; - })(); - - v1beta.GetAccountRequest = (function() { - - /** - * Properties of a GetAccountRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetAccountRequest - * @property {string|null} [name] GetAccountRequest name - */ - - /** - * Constructs a new GetAccountRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetAccountRequest. - * @implements IGetAccountRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest=} [properties] Properties to set - */ - function GetAccountRequest(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]]; - } - - /** - * GetAccountRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @instance - */ - GetAccountRequest.prototype.name = ""; - - /** - * Creates a new GetAccountRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetAccountRequest} GetAccountRequest instance - */ - GetAccountRequest.create = function create(properties) { - return new GetAccountRequest(properties); - }; - - /** - * Encodes the specified GetAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest} message GetAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAccountRequest.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 GetAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetAccountRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetAccountRequest} message GetAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAccountRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @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.GetAccountRequest} GetAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAccountRequest.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.GetAccountRequest(); - 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 GetAccountRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetAccountRequest} GetAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAccountRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAccountRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAccountRequest.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 GetAccountRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetAccountRequest} GetAccountRequest - */ - GetAccountRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetAccountRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetAccountRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAccountRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetAccountRequest} message GetAccountRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAccountRequest.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 GetAccountRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @instance - * @returns {Object.} JSON object - */ - GetAccountRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAccountRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetAccountRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetAccountRequest"; - }; - - return GetAccountRequest; - })(); - - v1beta.CreateAndConfigureAccountRequest = (function() { - - /** - * Properties of a CreateAndConfigureAccountRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ICreateAndConfigureAccountRequest - * @property {google.shopping.merchant.accounts.v1beta.IAccount|null} [account] CreateAndConfigureAccountRequest account - * @property {Array.|null} [users] CreateAndConfigureAccountRequest users - * @property {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService|null} [acceptTermsOfService] CreateAndConfigureAccountRequest acceptTermsOfService - * @property {Array.|null} [service] CreateAndConfigureAccountRequest service - */ - - /** - * Constructs a new CreateAndConfigureAccountRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a CreateAndConfigureAccountRequest. - * @implements ICreateAndConfigureAccountRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest=} [properties] Properties to set - */ - function CreateAndConfigureAccountRequest(properties) { - this.users = []; - this.service = []; - 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]]; - } - - /** - * CreateAndConfigureAccountRequest account. - * @member {google.shopping.merchant.accounts.v1beta.IAccount|null|undefined} account - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @instance - */ - CreateAndConfigureAccountRequest.prototype.account = null; - - /** - * CreateAndConfigureAccountRequest users. - * @member {Array.} users - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @instance - */ - CreateAndConfigureAccountRequest.prototype.users = $util.emptyArray; - - /** - * CreateAndConfigureAccountRequest acceptTermsOfService. - * @member {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService|null|undefined} acceptTermsOfService - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @instance - */ - CreateAndConfigureAccountRequest.prototype.acceptTermsOfService = null; - - /** - * CreateAndConfigureAccountRequest service. - * @member {Array.} service - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @instance - */ - CreateAndConfigureAccountRequest.prototype.service = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CreateAndConfigureAccountRequest _acceptTermsOfService. - * @member {"acceptTermsOfService"|undefined} _acceptTermsOfService - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @instance - */ - Object.defineProperty(CreateAndConfigureAccountRequest.prototype, "_acceptTermsOfService", { - get: $util.oneOfGetter($oneOfFields = ["acceptTermsOfService"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CreateAndConfigureAccountRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest} CreateAndConfigureAccountRequest instance - */ - CreateAndConfigureAccountRequest.create = function create(properties) { - return new CreateAndConfigureAccountRequest(properties); - }; - - /** - * Encodes the specified CreateAndConfigureAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest} message CreateAndConfigureAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAndConfigureAccountRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.account != null && Object.hasOwnProperty.call(message, "account")) - $root.google.shopping.merchant.accounts.v1beta.Account.encode(message.account, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.users != null && message.users.length) - for (var i = 0; i < message.users.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.encode(message.users[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.acceptTermsOfService != null && Object.hasOwnProperty.call(message, "acceptTermsOfService")) - $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.encode(message.acceptTermsOfService, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.encode(message.service[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateAndConfigureAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest} message CreateAndConfigureAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAndConfigureAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAndConfigureAccountRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @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.CreateAndConfigureAccountRequest} CreateAndConfigureAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAndConfigureAccountRequest.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.CreateAndConfigureAccountRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.account = $root.google.shopping.merchant.accounts.v1beta.Account.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.users && message.users.length)) - message.users = []; - message.users.push($root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.decode(reader, reader.uint32())); - break; - } - case 3: { - message.acceptTermsOfService = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAndConfigureAccountRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest} CreateAndConfigureAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAndConfigureAccountRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAndConfigureAccountRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAndConfigureAccountRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.account != null && message.hasOwnProperty("account")) { - var error = $root.google.shopping.merchant.accounts.v1beta.Account.verify(message.account); - if (error) - return "account." + error; - } - if (message.users != null && message.hasOwnProperty("users")) { - if (!Array.isArray(message.users)) - return "users: array expected"; - for (var i = 0; i < message.users.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify(message.users[i]); - if (error) - return "users." + error; - } - } - if (message.acceptTermsOfService != null && message.hasOwnProperty("acceptTermsOfService")) { - properties._acceptTermsOfService = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify(message.acceptTermsOfService); - if (error) - return "acceptTermsOfService." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify(message.service[i]); - if (error) - return "service." + error; - } - } - return null; - }; - - /** - * Creates a CreateAndConfigureAccountRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest} CreateAndConfigureAccountRequest - */ - CreateAndConfigureAccountRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest(); - if (object.account != null) { - if (typeof object.account !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.account: object expected"); - message.account = $root.google.shopping.merchant.accounts.v1beta.Account.fromObject(object.account); - } - if (object.users) { - if (!Array.isArray(object.users)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.users: array expected"); - message.users = []; - for (var i = 0; i < object.users.length; ++i) { - if (typeof object.users[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.users: object expected"); - message.users[i] = $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.fromObject(object.users[i]); - } - } - if (object.acceptTermsOfService != null) { - if (typeof object.acceptTermsOfService !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.acceptTermsOfService: object expected"); - message.acceptTermsOfService = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.fromObject(object.acceptTermsOfService); - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.service: object expected"); - message.service[i] = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.fromObject(object.service[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CreateAndConfigureAccountRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest} message CreateAndConfigureAccountRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAndConfigureAccountRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.users = []; - object.service = []; - } - if (options.defaults) - object.account = null; - if (message.account != null && message.hasOwnProperty("account")) - object.account = $root.google.shopping.merchant.accounts.v1beta.Account.toObject(message.account, options); - if (message.users && message.users.length) { - object.users = []; - for (var j = 0; j < message.users.length; ++j) - object.users[j] = $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest.toObject(message.users[j], options); - } - if (message.acceptTermsOfService != null && message.hasOwnProperty("acceptTermsOfService")) { - object.acceptTermsOfService = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.toObject(message.acceptTermsOfService, options); - if (options.oneofs) - object._acceptTermsOfService = "acceptTermsOfService"; - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.toObject(message.service[j], options); - } - return object; - }; - - /** - * Converts this CreateAndConfigureAccountRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAndConfigureAccountRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateAndConfigureAccountRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateAndConfigureAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest"; - }; - - CreateAndConfigureAccountRequest.AcceptTermsOfService = (function() { - - /** - * Properties of an AcceptTermsOfService. - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @interface IAcceptTermsOfService - * @property {string|null} [name] AcceptTermsOfService name - * @property {string|null} [regionCode] AcceptTermsOfService regionCode - */ - - /** - * Constructs a new AcceptTermsOfService. - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @classdesc Represents an AcceptTermsOfService. - * @implements IAcceptTermsOfService - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService=} [properties] Properties to set - */ - function AcceptTermsOfService(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]]; - } - - /** - * AcceptTermsOfService name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @instance - */ - AcceptTermsOfService.prototype.name = ""; - - /** - * AcceptTermsOfService regionCode. - * @member {string} regionCode - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @instance - */ - AcceptTermsOfService.prototype.regionCode = ""; - - /** - * Creates a new AcceptTermsOfService instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService} AcceptTermsOfService instance - */ - AcceptTermsOfService.create = function create(properties) { - return new AcceptTermsOfService(properties); - }; - - /** - * Encodes the specified AcceptTermsOfService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService} message AcceptTermsOfService message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcceptTermsOfService.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.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.regionCode); - return writer; - }; - - /** - * Encodes the specified AcceptTermsOfService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAcceptTermsOfService} message AcceptTermsOfService message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcceptTermsOfService.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AcceptTermsOfService message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @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.CreateAndConfigureAccountRequest.AcceptTermsOfService} AcceptTermsOfService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcceptTermsOfService.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.CreateAndConfigureAccountRequest.AcceptTermsOfService(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.regionCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AcceptTermsOfService message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService} AcceptTermsOfService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcceptTermsOfService.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AcceptTermsOfService message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AcceptTermsOfService.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.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - return null; - }; - - /** - * Creates an AcceptTermsOfService message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService} AcceptTermsOfService - */ - AcceptTermsOfService.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService(); - if (object.name != null) - message.name = String(object.name); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - return message; - }; - - /** - * Creates a plain object from an AcceptTermsOfService message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService} message AcceptTermsOfService - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AcceptTermsOfService.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.regionCode = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - return object; - }; - - /** - * Converts this AcceptTermsOfService to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @instance - * @returns {Object.} JSON object - */ - AcceptTermsOfService.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AcceptTermsOfService - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AcceptTermsOfService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService"; - }; - - return AcceptTermsOfService; - })(); - - CreateAndConfigureAccountRequest.AddAccountService = (function() { - - /** - * Properties of an AddAccountService. - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @interface IAddAccountService - * @property {google.shopping.merchant.accounts.v1beta.IAccountAggregation|null} [accountAggregation] AddAccountService accountAggregation - * @property {string|null} [provider] AddAccountService provider - */ - - /** - * Constructs a new AddAccountService. - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest - * @classdesc Represents an AddAccountService. - * @implements IAddAccountService - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService=} [properties] Properties to set - */ - function AddAccountService(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]]; - } - - /** - * AddAccountService accountAggregation. - * @member {google.shopping.merchant.accounts.v1beta.IAccountAggregation|null|undefined} accountAggregation - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @instance - */ - AddAccountService.prototype.accountAggregation = null; - - /** - * AddAccountService provider. - * @member {string|null|undefined} provider - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @instance - */ - AddAccountService.prototype.provider = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AddAccountService serviceType. - * @member {"accountAggregation"|undefined} serviceType - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @instance - */ - Object.defineProperty(AddAccountService.prototype, "serviceType", { - get: $util.oneOfGetter($oneOfFields = ["accountAggregation"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * AddAccountService _provider. - * @member {"provider"|undefined} _provider - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @instance - */ - Object.defineProperty(AddAccountService.prototype, "_provider", { - get: $util.oneOfGetter($oneOfFields = ["provider"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AddAccountService instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService} AddAccountService instance - */ - AddAccountService.create = function create(properties) { - return new AddAccountService(properties); - }; - - /** - * Encodes the specified AddAccountService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService} message AddAccountService message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddAccountService.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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.shopping.merchant.accounts.v1beta.AccountAggregation.encode(message.accountAggregation, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AddAccountService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.IAddAccountService} message AddAccountService message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AddAccountService.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AddAccountService message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @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.CreateAndConfigureAccountRequest.AddAccountService} AddAccountService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddAccountService.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.CreateAndConfigureAccountRequest.AddAccountService(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 103: { - message.accountAggregation = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.decode(reader, reader.uint32()); - break; - } - case 1: { - message.provider = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AddAccountService message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService} AddAccountService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AddAccountService.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AddAccountService message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AddAccountService.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.accountAggregation != null && message.hasOwnProperty("accountAggregation")) { - properties.serviceType = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.verify(message.accountAggregation); - if (error) - return "accountAggregation." + error; - } - } - if (message.provider != null && message.hasOwnProperty("provider")) { - properties._provider = 1; - if (!$util.isString(message.provider)) - return "provider: string expected"; - } - return null; - }; - - /** - * Creates an AddAccountService message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService} AddAccountService - */ - AddAccountService.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService(); - 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.shopping.merchant.accounts.v1beta.AccountAggregation.fromObject(object.accountAggregation); - } - if (object.provider != null) - message.provider = String(object.provider); - return message; - }; - - /** - * Creates a plain object from an AddAccountService message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService} message AddAccountService - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AddAccountService.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.provider != null && message.hasOwnProperty("provider")) { - object.provider = message.provider; - if (options.oneofs) - object._provider = "provider"; - } - if (message.accountAggregation != null && message.hasOwnProperty("accountAggregation")) { - object.accountAggregation = $root.google.shopping.merchant.accounts.v1beta.AccountAggregation.toObject(message.accountAggregation, options); - if (options.oneofs) - object.serviceType = "accountAggregation"; - } - return object; - }; - - /** - * Converts this AddAccountService to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @instance - * @returns {Object.} JSON object - */ - AddAccountService.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AddAccountService - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AddAccountService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AddAccountService"; - }; - - return AddAccountService; - })(); - - return CreateAndConfigureAccountRequest; - })(); - - v1beta.DeleteAccountRequest = (function() { - - /** - * Properties of a DeleteAccountRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IDeleteAccountRequest - * @property {string|null} [name] DeleteAccountRequest name - */ - - /** - * Constructs a new DeleteAccountRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a DeleteAccountRequest. - * @implements IDeleteAccountRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest=} [properties] Properties to set - */ - function DeleteAccountRequest(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]]; - } - - /** - * DeleteAccountRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @instance - */ - DeleteAccountRequest.prototype.name = ""; - - /** - * Creates a new DeleteAccountRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.DeleteAccountRequest} DeleteAccountRequest instance - */ - DeleteAccountRequest.create = function create(properties) { - return new DeleteAccountRequest(properties); - }; - - /** - * Encodes the specified DeleteAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteAccountRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest} message DeleteAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAccountRequest.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 DeleteAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteAccountRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest} message DeleteAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAccountRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @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.DeleteAccountRequest} DeleteAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAccountRequest.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.DeleteAccountRequest(); - 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 DeleteAccountRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.DeleteAccountRequest} DeleteAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAccountRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAccountRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAccountRequest.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 DeleteAccountRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.DeleteAccountRequest} DeleteAccountRequest - */ - DeleteAccountRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteAccountRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.DeleteAccountRequest} message DeleteAccountRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAccountRequest.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 DeleteAccountRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAccountRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteAccountRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.DeleteAccountRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DeleteAccountRequest"; - }; - - return DeleteAccountRequest; - })(); - - v1beta.UpdateAccountRequest = (function() { - - /** - * Properties of an UpdateAccountRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUpdateAccountRequest - * @property {google.shopping.merchant.accounts.v1beta.IAccount|null} [account] UpdateAccountRequest account - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAccountRequest updateMask - */ - - /** - * Constructs a new UpdateAccountRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an UpdateAccountRequest. - * @implements IUpdateAccountRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest=} [properties] Properties to set - */ - function UpdateAccountRequest(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]]; - } - - /** - * UpdateAccountRequest account. - * @member {google.shopping.merchant.accounts.v1beta.IAccount|null|undefined} account - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @instance - */ - UpdateAccountRequest.prototype.account = null; - - /** - * UpdateAccountRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @instance - */ - UpdateAccountRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateAccountRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountRequest} UpdateAccountRequest instance - */ - UpdateAccountRequest.create = function create(properties) { - return new UpdateAccountRequest(properties); - }; - - /** - * Encodes the specified UpdateAccountRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest} message UpdateAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAccountRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.account != null && Object.hasOwnProperty.call(message, "account")) - $root.google.shopping.merchant.accounts.v1beta.Account.encode(message.account, 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 UpdateAccountRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest} message UpdateAccountRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateAccountRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @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.UpdateAccountRequest} UpdateAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAccountRequest.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.UpdateAccountRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.account = $root.google.shopping.merchant.accounts.v1beta.Account.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 UpdateAccountRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountRequest} UpdateAccountRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAccountRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateAccountRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateAccountRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.account != null && message.hasOwnProperty("account")) { - var error = $root.google.shopping.merchant.accounts.v1beta.Account.verify(message.account); - if (error) - return "account." + 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 UpdateAccountRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.UpdateAccountRequest} UpdateAccountRequest - */ - UpdateAccountRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest(); - if (object.account != null) { - if (typeof object.account !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.account: object expected"); - message.account = $root.google.shopping.merchant.accounts.v1beta.Account.fromObject(object.account); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateAccountRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateAccountRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.UpdateAccountRequest} message UpdateAccountRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateAccountRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.account = null; - object.updateMask = null; - } - if (message.account != null && message.hasOwnProperty("account")) - object.account = $root.google.shopping.merchant.accounts.v1beta.Account.toObject(message.account, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateAccountRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateAccountRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateAccountRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.UpdateAccountRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateAccountRequest"; - }; - - return UpdateAccountRequest; - })(); - - v1beta.ListAccountsRequest = (function() { - - /** - * Properties of a ListAccountsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListAccountsRequest - * @property {number|null} [pageSize] ListAccountsRequest pageSize - * @property {string|null} [pageToken] ListAccountsRequest pageToken - * @property {string|null} [filter] ListAccountsRequest filter - */ - - /** - * Constructs a new ListAccountsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListAccountsRequest. - * @implements IListAccountsRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest=} [properties] Properties to set - */ - function ListAccountsRequest(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]]; - } - - /** - * ListAccountsRequest pageSize. - * @member {number} pageSize - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @instance - */ - ListAccountsRequest.prototype.pageSize = 0; - - /** - * ListAccountsRequest pageToken. - * @member {string} pageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @instance - */ - ListAccountsRequest.prototype.pageToken = ""; - - /** - * ListAccountsRequest filter. - * @member {string} filter - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @instance - */ - ListAccountsRequest.prototype.filter = ""; - - /** - * Creates a new ListAccountsRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsRequest} ListAccountsRequest instance - */ - ListAccountsRequest.create = function create(properties) { - return new ListAccountsRequest(properties); - }; - - /** - * Encodes the specified ListAccountsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest} message ListAccountsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListAccountsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsRequest} message ListAccountsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAccountsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @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.ListAccountsRequest} ListAccountsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountsRequest.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.ListAccountsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.pageSize = reader.int32(); - break; - } - case 2: { - message.pageToken = reader.string(); - break; - } - case 3: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAccountsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsRequest} ListAccountsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAccountsRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAccountsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a ListAccountsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsRequest} ListAccountsRequest - */ - ListAccountsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountsRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountsRequest(); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a ListAccountsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListAccountsRequest} message ListAccountsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAccountsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListAccountsRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @instance - * @returns {Object.} JSON object - */ - ListAccountsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAccountsRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAccountsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountsRequest"; - }; - - return ListAccountsRequest; - })(); - - v1beta.ListAccountsResponse = (function() { - - /** - * Properties of a ListAccountsResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListAccountsResponse - * @property {Array.|null} [accounts] ListAccountsResponse accounts - * @property {string|null} [nextPageToken] ListAccountsResponse nextPageToken - */ - - /** - * Constructs a new ListAccountsResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListAccountsResponse. - * @implements IListAccountsResponse - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsResponse=} [properties] Properties to set - */ - function ListAccountsResponse(properties) { - this.accounts = []; - 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]]; - } - - /** - * ListAccountsResponse accounts. - * @member {Array.} accounts - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @instance - */ - ListAccountsResponse.prototype.accounts = $util.emptyArray; - - /** - * ListAccountsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @instance - */ - ListAccountsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAccountsResponse instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsResponse=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} ListAccountsResponse instance - */ - ListAccountsResponse.create = function create(properties) { - return new ListAccountsResponse(properties); - }; - - /** - * Encodes the specified ListAccountsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsResponse.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsResponse} message ListAccountsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.accounts != null && message.accounts.length) - for (var i = 0; i < message.accounts.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Account.encode(message.accounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListAccountsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListAccountsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListAccountsResponse} message ListAccountsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAccountsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAccountsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @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.ListAccountsResponse} ListAccountsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountsResponse.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.ListAccountsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.accounts && message.accounts.length)) - message.accounts = []; - message.accounts.push($root.google.shopping.merchant.accounts.v1beta.Account.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAccountsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} ListAccountsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAccountsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAccountsResponse message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAccountsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.accounts != null && message.hasOwnProperty("accounts")) { - if (!Array.isArray(message.accounts)) - return "accounts: array expected"; - for (var i = 0; i < message.accounts.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Account.verify(message.accounts[i]); - if (error) - return "accounts." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAccountsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} ListAccountsResponse - */ - ListAccountsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListAccountsResponse) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListAccountsResponse(); - if (object.accounts) { - if (!Array.isArray(object.accounts)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountsResponse.accounts: array expected"); - message.accounts = []; - for (var i = 0; i < object.accounts.length; ++i) { - if (typeof object.accounts[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListAccountsResponse.accounts: object expected"); - message.accounts[i] = $root.google.shopping.merchant.accounts.v1beta.Account.fromObject(object.accounts[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAccountsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListAccountsResponse} message ListAccountsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAccountsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.accounts = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.accounts && message.accounts.length) { - object.accounts = []; - for (var j = 0; j < message.accounts.length; ++j) - object.accounts[j] = $root.google.shopping.merchant.accounts.v1beta.Account.toObject(message.accounts[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAccountsResponse to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @instance - * @returns {Object.} JSON object - */ - ListAccountsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAccountsResponse - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListAccountsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAccountsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListAccountsResponse"; - }; - - return ListAccountsResponse; - })(); - - v1beta.ListSubAccountsRequest = (function() { - - /** - * Properties of a ListSubAccountsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListSubAccountsRequest - * @property {string|null} [provider] ListSubAccountsRequest provider - * @property {number|null} [pageSize] ListSubAccountsRequest pageSize - * @property {string|null} [pageToken] ListSubAccountsRequest pageToken - */ - - /** - * Constructs a new ListSubAccountsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListSubAccountsRequest. - * @implements IListSubAccountsRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest=} [properties] Properties to set - */ - function ListSubAccountsRequest(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]]; - } - - /** - * ListSubAccountsRequest provider. - * @member {string} provider - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @instance - */ - ListSubAccountsRequest.prototype.provider = ""; - - /** - * ListSubAccountsRequest pageSize. - * @member {number} pageSize - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @instance - */ - ListSubAccountsRequest.prototype.pageSize = 0; - - /** - * ListSubAccountsRequest pageToken. - * @member {string} pageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @instance - */ - ListSubAccountsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListSubAccountsRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest} ListSubAccountsRequest instance - */ - ListSubAccountsRequest.create = function create(properties) { - return new ListSubAccountsRequest(properties); - }; - - /** - * Encodes the specified ListSubAccountsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest} message ListSubAccountsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSubAccountsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.provider); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListSubAccountsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest} message ListSubAccountsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSubAccountsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSubAccountsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @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.ListSubAccountsRequest} ListSubAccountsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSubAccountsRequest.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.ListSubAccountsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.provider = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSubAccountsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest} ListSubAccountsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSubAccountsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSubAccountsRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSubAccountsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.provider != null && message.hasOwnProperty("provider")) - if (!$util.isString(message.provider)) - return "provider: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListSubAccountsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest} ListSubAccountsRequest - */ - ListSubAccountsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest(); - if (object.provider != null) - message.provider = String(object.provider); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListSubAccountsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest} message ListSubAccountsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSubAccountsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.provider = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.provider != null && message.hasOwnProperty("provider")) - object.provider = message.provider; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListSubAccountsRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSubAccountsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSubAccountsRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSubAccountsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest"; - }; - - return ListSubAccountsRequest; - })(); - - v1beta.ListSubAccountsResponse = (function() { - - /** - * Properties of a ListSubAccountsResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListSubAccountsResponse - * @property {Array.|null} [accounts] ListSubAccountsResponse accounts - * @property {string|null} [nextPageToken] ListSubAccountsResponse nextPageToken - */ - - /** - * Constructs a new ListSubAccountsResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListSubAccountsResponse. - * @implements IListSubAccountsResponse - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse=} [properties] Properties to set - */ - function ListSubAccountsResponse(properties) { - this.accounts = []; - 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]]; - } - - /** - * ListSubAccountsResponse accounts. - * @member {Array.} accounts - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @instance - */ - ListSubAccountsResponse.prototype.accounts = $util.emptyArray; - - /** - * ListSubAccountsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @instance - */ - ListSubAccountsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSubAccountsResponse instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} ListSubAccountsResponse instance - */ - ListSubAccountsResponse.create = function create(properties) { - return new ListSubAccountsResponse(properties); - }; - - /** - * Encodes the specified ListSubAccountsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse} message ListSubAccountsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSubAccountsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.accounts != null && message.accounts.length) - for (var i = 0; i < message.accounts.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Account.encode(message.accounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListSubAccountsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse} message ListSubAccountsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSubAccountsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSubAccountsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @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.ListSubAccountsResponse} ListSubAccountsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSubAccountsResponse.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.ListSubAccountsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.accounts && message.accounts.length)) - message.accounts = []; - message.accounts.push($root.google.shopping.merchant.accounts.v1beta.Account.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSubAccountsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} ListSubAccountsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSubAccountsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSubAccountsResponse message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSubAccountsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.accounts != null && message.hasOwnProperty("accounts")) { - if (!Array.isArray(message.accounts)) - return "accounts: array expected"; - for (var i = 0; i < message.accounts.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Account.verify(message.accounts[i]); - if (error) - return "accounts." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSubAccountsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} ListSubAccountsResponse - */ - ListSubAccountsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse(); - if (object.accounts) { - if (!Array.isArray(object.accounts)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.accounts: array expected"); - message.accounts = []; - for (var i = 0; i < object.accounts.length; ++i) { - if (typeof object.accounts[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse.accounts: object expected"); - message.accounts[i] = $root.google.shopping.merchant.accounts.v1beta.Account.fromObject(object.accounts[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSubAccountsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse} message ListSubAccountsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSubAccountsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.accounts = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.accounts && message.accounts.length) { - object.accounts = []; - for (var j = 0; j < message.accounts.length; ++j) - object.accounts[j] = $root.google.shopping.merchant.accounts.v1beta.Account.toObject(message.accounts[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSubAccountsResponse to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSubAccountsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSubAccountsResponse - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSubAccountsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse"; - }; - - 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() { - - /** - * Constructs a new UserService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a UserService - * @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 UserService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (UserService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UserService; - - /** - * Creates new UserService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @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 {UserService} RPC service. Useful where requests and/or responses are streamed. - */ - UserService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|getUser}. - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @typedef GetUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.User} [response] User - */ - - /** - * Calls GetUser. - * @function getUser - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest} request GetUserRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.UserService.GetUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserService.prototype.getUser = function getUser(request, callback) { - return this.rpcCall(getUser, $root.google.shopping.merchant.accounts.v1beta.GetUserRequest, $root.google.shopping.merchant.accounts.v1beta.User, request, callback); - }, "name", { value: "GetUser" }); - - /** - * Calls GetUser. - * @function getUser - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest} request GetUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|createUser}. - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @typedef CreateUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.User} [response] User - */ - - /** - * Calls CreateUser. - * @function createUser - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.UserService.CreateUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserService.prototype.createUser = function createUser(request, callback) { - return this.rpcCall(createUser, $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest, $root.google.shopping.merchant.accounts.v1beta.User, request, callback); - }, "name", { value: "CreateUser" }); - - /** - * Calls CreateUser. - * @function createUser - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest} request CreateUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|deleteUser}. - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @typedef DeleteUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteUser. - * @function deleteUser - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.UserService.DeleteUserCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserService.prototype.deleteUser = function deleteUser(request, callback) { - return this.rpcCall(deleteUser, $root.google.shopping.merchant.accounts.v1beta.DeleteUserRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteUser" }); - - /** - * Calls DeleteUser. - * @function deleteUser - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest} request DeleteUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|updateUser}. - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @typedef UpdateUserCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.User} [response] User - */ - - /** - * Calls UpdateUser. - * @function updateUser - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.UserService.UpdateUserCallback} callback Node-style callback called with the error, if any, and User - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserService.prototype.updateUser = function updateUser(request, callback) { - return this.rpcCall(updateUser, $root.google.shopping.merchant.accounts.v1beta.UpdateUserRequest, $root.google.shopping.merchant.accounts.v1beta.User, request, callback); - }, "name", { value: "UpdateUser" }); - - /** - * Calls UpdateUser. - * @function updateUser - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest} request UpdateUserRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.UserService|listUsers}. - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @typedef ListUsersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ListUsersResponse} [response] ListUsersResponse - */ - - /** - * Calls ListUsers. - * @function listUsers - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest} request ListUsersRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.UserService.ListUsersCallback} callback Node-style callback called with the error, if any, and ListUsersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(UserService.prototype.listUsers = function listUsers(request, callback) { - return this.rpcCall(listUsers, $root.google.shopping.merchant.accounts.v1beta.ListUsersRequest, $root.google.shopping.merchant.accounts.v1beta.ListUsersResponse, request, callback); - }, "name", { value: "ListUsers" }); - - /** - * Calls ListUsers. - * @function listUsers - * @memberof google.shopping.merchant.accounts.v1beta.UserService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest} request ListUsersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return UserService; - })(); - - v1beta.User = (function() { - - /** - * Properties of a User. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUser - * @property {string|null} [name] User name - * @property {google.shopping.merchant.accounts.v1beta.User.State|null} [state] User state - * @property {Array.|null} [accessRights] User accessRights - */ - - /** - * Constructs a new User. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a User. - * @implements IUser - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUser=} [properties] Properties to set - */ - function User(properties) { - this.accessRights = []; - 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]]; - } - - /** - * User name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.User - * @instance - */ - User.prototype.name = ""; - - /** - * User state. - * @member {google.shopping.merchant.accounts.v1beta.User.State} state - * @memberof google.shopping.merchant.accounts.v1beta.User - * @instance - */ - User.prototype.state = 0; - - /** - * User accessRights. - * @member {Array.} accessRights - * @memberof google.shopping.merchant.accounts.v1beta.User - * @instance - */ - User.prototype.accessRights = $util.emptyArray; - - /** - * Creates a new User instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.User - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUser=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.User} User instance - */ - User.create = function create(properties) { - return new User(properties); - }; - - /** - * Encodes the specified User message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.User.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.User - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUser} message User message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - User.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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.accessRights != null && message.accessRights.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.accessRights.length; ++i) - writer.int32(message.accessRights[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.User.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.User - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUser} message User message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - User.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a User message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.User - * @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.User} User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - User.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.User(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 4: { - if (!(message.accessRights && message.accessRights.length)) - message.accessRights = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.accessRights.push(reader.int32()); - } else - message.accessRights.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a User message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.User - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.User} User - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - User.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a User message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.User - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - User.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.accessRights != null && message.hasOwnProperty("accessRights")) { - if (!Array.isArray(message.accessRights)) - return "accessRights: array expected"; - for (var i = 0; i < message.accessRights.length; ++i) - switch (message.accessRights[i]) { - default: - return "accessRights: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - return null; - }; - - /** - * Creates a User message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.User - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.User} User - */ - User.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.User) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.User(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "VERIFIED": - case 2: - message.state = 2; - break; - } - if (object.accessRights) { - if (!Array.isArray(object.accessRights)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.User.accessRights: array expected"); - message.accessRights = []; - for (var i = 0; i < object.accessRights.length; ++i) - switch (object.accessRights[i]) { - default: - if (typeof object.accessRights[i] === "number") { - message.accessRights[i] = object.accessRights[i]; - break; - } - case "ACCESS_RIGHT_UNSPECIFIED": - case 0: - message.accessRights[i] = 0; - break; - case "STANDARD": - case 1: - message.accessRights[i] = 1; - break; - case "ADMIN": - case 2: - message.accessRights[i] = 2; - break; - case "PERFORMANCE_REPORTING": - case 3: - message.accessRights[i] = 3; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a User message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.User - * @static - * @param {google.shopping.merchant.accounts.v1beta.User} message User - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - User.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.accessRights = []; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.User.State[message.state] === undefined ? message.state : $root.google.shopping.merchant.accounts.v1beta.User.State[message.state] : message.state; - if (message.accessRights && message.accessRights.length) { - object.accessRights = []; - for (var j = 0; j < message.accessRights.length; ++j) - object.accessRights[j] = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.AccessRight[message.accessRights[j]] === undefined ? message.accessRights[j] : $root.google.shopping.merchant.accounts.v1beta.AccessRight[message.accessRights[j]] : message.accessRights[j]; - } - return object; - }; - - /** - * Converts this User to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.User - * @instance - * @returns {Object.} JSON object - */ - User.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for User - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.User - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.User"; - }; - - /** - * State enum. - * @name google.shopping.merchant.accounts.v1beta.User.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} VERIFIED=2 VERIFIED value - */ - User.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "VERIFIED"] = 2; - return values; - })(); - - return User; - })(); - - v1beta.GetUserRequest = (function() { - - /** - * Properties of a GetUserRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetUserRequest - * @property {string|null} [name] GetUserRequest name - */ - - /** - * Constructs a new GetUserRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetUserRequest. - * @implements IGetUserRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest=} [properties] Properties to set - */ - function GetUserRequest(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]]; - } - - /** - * GetUserRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @instance - */ - GetUserRequest.prototype.name = ""; - - /** - * Creates a new GetUserRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetUserRequest} GetUserRequest instance - */ - GetUserRequest.create = function create(properties) { - return new GetUserRequest(properties); - }; - - /** - * Encodes the specified GetUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetUserRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetUserRequest.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 GetUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetUserRequest} message GetUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @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.GetUserRequest} GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetUserRequest.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.GetUserRequest(); - 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 GetUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetUserRequest} GetUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetUserRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetUserRequest.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 GetUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetUserRequest} GetUserRequest - */ - GetUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetUserRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetUserRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetUserRequest} message GetUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetUserRequest.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 GetUserRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @instance - * @returns {Object.} JSON object - */ - GetUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetUserRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetUserRequest"; - }; - - return GetUserRequest; - })(); - - v1beta.CreateUserRequest = (function() { - - /** - * Properties of a CreateUserRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ICreateUserRequest - * @property {string|null} [parent] CreateUserRequest parent - * @property {string|null} [userId] CreateUserRequest userId - * @property {google.shopping.merchant.accounts.v1beta.IUser|null} [user] CreateUserRequest user - */ - - /** - * Constructs a new CreateUserRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a CreateUserRequest. - * @implements ICreateUserRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest=} [properties] Properties to set - */ - function CreateUserRequest(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]]; - } - - /** - * CreateUserRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.parent = ""; - - /** - * CreateUserRequest userId. - * @member {string} userId - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.userId = ""; - - /** - * CreateUserRequest user. - * @member {google.shopping.merchant.accounts.v1beta.IUser|null|undefined} user - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @instance - */ - CreateUserRequest.prototype.user = null; - - /** - * Creates a new CreateUserRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.CreateUserRequest} CreateUserRequest instance - */ - CreateUserRequest.create = function create(properties) { - return new CreateUserRequest(properties); - }; - - /** - * Encodes the specified CreateUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.userId != null && Object.hasOwnProperty.call(message, "userId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.userId); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - $root.google.shopping.merchant.accounts.v1beta.User.encode(message.user, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICreateUserRequest} message CreateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @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.CreateUserRequest} CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserRequest.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.CreateUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.userId = reader.string(); - break; - } - case 3: { - message.user = $root.google.shopping.merchant.accounts.v1beta.User.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.CreateUserRequest} CreateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateUserRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.userId != null && message.hasOwnProperty("userId")) - if (!$util.isString(message.userId)) - return "userId: string expected"; - if (message.user != null && message.hasOwnProperty("user")) { - var error = $root.google.shopping.merchant.accounts.v1beta.User.verify(message.user); - if (error) - return "user." + error; - } - return null; - }; - - /** - * Creates a CreateUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.CreateUserRequest} CreateUserRequest - */ - CreateUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.CreateUserRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.userId != null) - message.userId = String(object.userId); - if (object.user != null) { - if (typeof object.user !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateUserRequest.user: object expected"); - message.user = $root.google.shopping.merchant.accounts.v1beta.User.fromObject(object.user); - } - return message; - }; - - /** - * Creates a plain object from a CreateUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateUserRequest} message CreateUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.userId = ""; - object.user = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.userId != null && message.hasOwnProperty("userId")) - object.userId = message.userId; - if (message.user != null && message.hasOwnProperty("user")) - object.user = $root.google.shopping.merchant.accounts.v1beta.User.toObject(message.user, options); - return object; - }; - - /** - * Converts this CreateUserRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @instance - * @returns {Object.} JSON object - */ - CreateUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateUserRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.CreateUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateUserRequest"; - }; - - return CreateUserRequest; - })(); - - v1beta.DeleteUserRequest = (function() { - - /** - * Properties of a DeleteUserRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IDeleteUserRequest - * @property {string|null} [name] DeleteUserRequest name - */ - - /** - * Constructs a new DeleteUserRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a DeleteUserRequest. - * @implements IDeleteUserRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest=} [properties] Properties to set - */ - function DeleteUserRequest(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]]; - } - - /** - * DeleteUserRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @instance - */ - DeleteUserRequest.prototype.name = ""; - - /** - * Creates a new DeleteUserRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.DeleteUserRequest} DeleteUserRequest instance - */ - DeleteUserRequest.create = function create(properties) { - return new DeleteUserRequest(properties); - }; - - /** - * Encodes the specified DeleteUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteUserRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserRequest.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 DeleteUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeleteUserRequest} message DeleteUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @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.DeleteUserRequest} DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserRequest.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.DeleteUserRequest(); - 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 DeleteUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.DeleteUserRequest} DeleteUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteUserRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteUserRequest.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 DeleteUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.DeleteUserRequest} DeleteUserRequest - */ - DeleteUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DeleteUserRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.DeleteUserRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.DeleteUserRequest} message DeleteUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteUserRequest.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 DeleteUserRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteUserRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.DeleteUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DeleteUserRequest"; - }; - - return DeleteUserRequest; - })(); - - v1beta.UpdateUserRequest = (function() { - - /** - * Properties of an UpdateUserRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUpdateUserRequest - * @property {google.shopping.merchant.accounts.v1beta.IUser|null} [user] UpdateUserRequest user - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUserRequest updateMask - */ - - /** - * Constructs a new UpdateUserRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an UpdateUserRequest. - * @implements IUpdateUserRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest=} [properties] Properties to set - */ - function UpdateUserRequest(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]]; - } - - /** - * UpdateUserRequest user. - * @member {google.shopping.merchant.accounts.v1beta.IUser|null|undefined} user - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.user = null; - - /** - * UpdateUserRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @instance - */ - UpdateUserRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateUserRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.UpdateUserRequest} UpdateUserRequest instance - */ - UpdateUserRequest.create = function create(properties) { - return new UpdateUserRequest(properties); - }; - - /** - * Encodes the specified UpdateUserRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateUserRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - $root.google.shopping.merchant.accounts.v1beta.User.encode(message.user, 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 UpdateUserRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateUserRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateUserRequest} message UpdateUserRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateUserRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateUserRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @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.UpdateUserRequest} UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserRequest.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.UpdateUserRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.user = $root.google.shopping.merchant.accounts.v1beta.User.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 UpdateUserRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.UpdateUserRequest} UpdateUserRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateUserRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateUserRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateUserRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.user != null && message.hasOwnProperty("user")) { - var error = $root.google.shopping.merchant.accounts.v1beta.User.verify(message.user); - if (error) - return "user." + 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 UpdateUserRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.UpdateUserRequest} UpdateUserRequest - */ - UpdateUserRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateUserRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateUserRequest(); - if (object.user != null) { - if (typeof object.user !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateUserRequest.user: object expected"); - message.user = $root.google.shopping.merchant.accounts.v1beta.User.fromObject(object.user); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateUserRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateUserRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.UpdateUserRequest} message UpdateUserRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateUserRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.user = null; - object.updateMask = null; - } - if (message.user != null && message.hasOwnProperty("user")) - object.user = $root.google.shopping.merchant.accounts.v1beta.User.toObject(message.user, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateUserRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateUserRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateUserRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.UpdateUserRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateUserRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateUserRequest"; - }; - - return UpdateUserRequest; - })(); - - v1beta.ListUsersRequest = (function() { - - /** - * Properties of a ListUsersRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListUsersRequest - * @property {string|null} [parent] ListUsersRequest parent - * @property {number|null} [pageSize] ListUsersRequest pageSize - * @property {string|null} [pageToken] ListUsersRequest pageToken - */ - - /** - * Constructs a new ListUsersRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListUsersRequest. - * @implements IListUsersRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest=} [properties] Properties to set - */ - function ListUsersRequest(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]]; - } - - /** - * ListUsersRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.parent = ""; - - /** - * ListUsersRequest pageSize. - * @member {number} pageSize - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.pageSize = 0; - - /** - * ListUsersRequest pageToken. - * @member {string} pageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @instance - */ - ListUsersRequest.prototype.pageToken = ""; - - /** - * Creates a new ListUsersRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListUsersRequest} ListUsersRequest instance - */ - ListUsersRequest.create = function create(properties) { - return new ListUsersRequest(properties); - }; - - /** - * Encodes the specified ListUsersRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListUsersRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListUsersRequest} message ListUsersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @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.ListUsersRequest} ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersRequest.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.ListUsersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListUsersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListUsersRequest} ListUsersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListUsersRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListUsersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListUsersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListUsersRequest} ListUsersRequest - */ - ListUsersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListUsersRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListUsersRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListUsersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListUsersRequest} message ListUsersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListUsersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListUsersRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @instance - * @returns {Object.} JSON object - */ - ListUsersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListUsersRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListUsersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListUsersRequest"; - }; - - return ListUsersRequest; - })(); - - v1beta.ListUsersResponse = (function() { - - /** - * Properties of a ListUsersResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListUsersResponse - * @property {Array.|null} [users] ListUsersResponse users - * @property {string|null} [nextPageToken] ListUsersResponse nextPageToken - */ - - /** - * Constructs a new ListUsersResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListUsersResponse. - * @implements IListUsersResponse - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListUsersResponse=} [properties] Properties to set - */ - function ListUsersResponse(properties) { - this.users = []; - 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]]; - } - - /** - * ListUsersResponse users. - * @member {Array.} users - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.users = $util.emptyArray; - - /** - * ListUsersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @instance - */ - ListUsersResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListUsersResponse instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListUsersResponse=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListUsersResponse} ListUsersResponse instance - */ - ListUsersResponse.create = function create(properties) { - return new ListUsersResponse(properties); - }; - - /** - * Encodes the specified ListUsersResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersResponse.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.users != null && message.users.length) - for (var i = 0; i < message.users.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.User.encode(message.users[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListUsersResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListUsersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListUsersResponse} message ListUsersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListUsersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @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.ListUsersResponse} ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersResponse.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.ListUsersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.users && message.users.length)) - message.users = []; - message.users.push($root.google.shopping.merchant.accounts.v1beta.User.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListUsersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListUsersResponse} ListUsersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListUsersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListUsersResponse message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListUsersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.users != null && message.hasOwnProperty("users")) { - if (!Array.isArray(message.users)) - return "users: array expected"; - for (var i = 0; i < message.users.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.User.verify(message.users[i]); - if (error) - return "users." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListUsersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListUsersResponse} ListUsersResponse - */ - ListUsersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListUsersResponse) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListUsersResponse(); - if (object.users) { - if (!Array.isArray(object.users)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListUsersResponse.users: array expected"); - message.users = []; - for (var i = 0; i < object.users.length; ++i) { - if (typeof object.users[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListUsersResponse.users: object expected"); - message.users[i] = $root.google.shopping.merchant.accounts.v1beta.User.fromObject(object.users[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListUsersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListUsersResponse} message ListUsersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListUsersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.users = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.users && message.users.length) { - object.users = []; - for (var j = 0; j < message.users.length; ++j) - object.users[j] = $root.google.shopping.merchant.accounts.v1beta.User.toObject(message.users[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListUsersResponse to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @instance - * @returns {Object.} JSON object - */ - ListUsersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListUsersResponse - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListUsersResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListUsersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListUsersResponse"; - }; - - return ListUsersResponse; - })(); - - v1beta.AutofeedSettingsService = (function() { - - /** - * Constructs a new AutofeedSettingsService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @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 AutofeedSettingsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AutofeedSettingsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutofeedSettingsService; - - /** - * Creates new AutofeedSettingsService service using the specified rpc implementation. - * @function create - * @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 {AutofeedSettingsService} RPC service. Useful where requests and/or responses are streamed. - */ - AutofeedSettingsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * 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.AutofeedSettings} [response] AutofeedSettings - */ - - /** - * Calls GetAutofeedSettings. - * @function getAutofeedSettings - * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService - * @instance - * @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(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 GetAutofeedSettings. - * @function getAutofeedSettings - * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService - * @instance - * @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.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.AutofeedSettings} [response] AutofeedSettings - */ - - /** - * Calls UpdateAutofeedSettings. - * @function updateAutofeedSettings - * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService - * @instance - * @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(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 UpdateAutofeedSettings. - * @function updateAutofeedSettings - * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettingsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateAutofeedSettingsRequest} request UpdateAutofeedSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AutofeedSettingsService; - })(); - - v1beta.AutofeedSettings = (function() { - - /** - * Properties of an AutofeedSettings. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IAutofeedSettings - * @property {string|null} [name] AutofeedSettings name - * @property {boolean|null} [enableProducts] AutofeedSettings enableProducts - * @property {boolean|null} [eligible] AutofeedSettings eligible - */ - - /** - * Constructs a new AutofeedSettings. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an AutofeedSettings. - * @implements IAutofeedSettings - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IAutofeedSettings=} [properties] Properties to set - */ - function AutofeedSettings(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]]; - } - - /** - * AutofeedSettings name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings - * @instance - */ - AutofeedSettings.prototype.name = ""; - - /** - * AutofeedSettings enableProducts. - * @member {boolean} enableProducts - * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings - * @instance - */ - AutofeedSettings.prototype.enableProducts = false; - - /** - * AutofeedSettings eligible. - * @member {boolean} eligible - * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings - * @instance - */ - AutofeedSettings.prototype.eligible = false; - - /** - * Creates a new AutofeedSettings instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.AutofeedSettings - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAutofeedSettings=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.AutofeedSettings} AutofeedSettings instance - */ - AutofeedSettings.create = function create(properties) { - return new AutofeedSettings(properties); - }; - - /** - * 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.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.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.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(); - if (message.womenOwned != null && Object.hasOwnProperty.call(message, "womenOwned")) - $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.encode(message.womenOwned, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.veteranOwned != null && Object.hasOwnProperty.call(message, "veteranOwned")) - $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.encode(message.veteranOwned, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.latinoOwned != null && Object.hasOwnProperty.call(message, "latinoOwned")) - $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.encode(message.latinoOwned, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.smallBusiness != null && Object.hasOwnProperty.call(message, "smallBusiness")) - $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.encode(message.smallBusiness, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BusinessIdentity message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify|verify} messages. - * @function encodeDelimited - * @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.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BusinessIdentity message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @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.BusinessIdentity} BusinessIdentity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BusinessIdentity.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.BusinessIdentity(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.promotionsConsent = reader.int32(); - break; - } - case 3: { - message.blackOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); - break; - } - case 4: { - message.womenOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); - break; - } - case 5: { - message.veteranOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); - break; - } - case 6: { - message.latinoOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); - break; - } - case 7: { - message.smallBusiness = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BusinessIdentity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity} BusinessIdentity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BusinessIdentity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BusinessIdentity message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BusinessIdentity.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.promotionsConsent != null && message.hasOwnProperty("promotionsConsent")) - switch (message.promotionsConsent) { - default: - return "promotionsConsent: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.blackOwned != null && message.hasOwnProperty("blackOwned")) { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.blackOwned); - if (error) - return "blackOwned." + error; - } - if (message.womenOwned != null && message.hasOwnProperty("womenOwned")) { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.womenOwned); - if (error) - return "womenOwned." + error; - } - if (message.veteranOwned != null && message.hasOwnProperty("veteranOwned")) { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.veteranOwned); - if (error) - return "veteranOwned." + error; - } - if (message.latinoOwned != null && message.hasOwnProperty("latinoOwned")) { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.latinoOwned); - if (error) - return "latinoOwned." + error; - } - if (message.smallBusiness != null && message.hasOwnProperty("smallBusiness")) { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify(message.smallBusiness); - if (error) - return "smallBusiness." + error; - } - return null; - }; - - /** - * Creates a BusinessIdentity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity} BusinessIdentity - */ - BusinessIdentity.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity(); - if (object.name != null) - message.name = String(object.name); - switch (object.promotionsConsent) { - default: - if (typeof object.promotionsConsent === "number") { - message.promotionsConsent = object.promotionsConsent; - break; - } - break; - case "PROMOTIONS_CONSENT_UNSPECIFIED": - case 0: - message.promotionsConsent = 0; - break; - case "PROMOTIONS_CONSENT_GIVEN": - case 1: - message.promotionsConsent = 1; - break; - case "PROMOTIONS_CONSENT_DENIED": - case 2: - message.promotionsConsent = 2; - break; - } - if (object.blackOwned != null) { - if (typeof object.blackOwned !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.blackOwned: object expected"); - message.blackOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.blackOwned); - } - if (object.womenOwned != null) { - if (typeof object.womenOwned !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.womenOwned: object expected"); - message.womenOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.womenOwned); - } - if (object.veteranOwned != null) { - if (typeof object.veteranOwned !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.veteranOwned: object expected"); - message.veteranOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.veteranOwned); - } - if (object.latinoOwned != null) { - if (typeof object.latinoOwned !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.latinoOwned: object expected"); - message.latinoOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.latinoOwned); - } - if (object.smallBusiness != null) { - if (typeof object.smallBusiness !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessIdentity.smallBusiness: object expected"); - message.smallBusiness = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.fromObject(object.smallBusiness); - } - return message; - }; - - /** - * Creates a plain object from a BusinessIdentity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @static - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity} message BusinessIdentity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BusinessIdentity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.promotionsConsent = options.enums === String ? "PROMOTIONS_CONSENT_UNSPECIFIED" : 0; - object.blackOwned = null; - object.womenOwned = null; - object.veteranOwned = null; - object.latinoOwned = null; - object.smallBusiness = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.promotionsConsent != null && message.hasOwnProperty("promotionsConsent")) - object.promotionsConsent = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent[message.promotionsConsent] === undefined ? message.promotionsConsent : $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent[message.promotionsConsent] : message.promotionsConsent; - if (message.blackOwned != null && message.hasOwnProperty("blackOwned")) - object.blackOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.blackOwned, options); - if (message.womenOwned != null && message.hasOwnProperty("womenOwned")) - object.womenOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.womenOwned, options); - if (message.veteranOwned != null && message.hasOwnProperty("veteranOwned")) - object.veteranOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.veteranOwned, options); - if (message.latinoOwned != null && message.hasOwnProperty("latinoOwned")) - object.latinoOwned = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.latinoOwned, options); - if (message.smallBusiness != null && message.hasOwnProperty("smallBusiness")) - object.smallBusiness = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.toObject(message.smallBusiness, options); - return object; - }; - - /** - * Converts this BusinessIdentity to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @instance - * @returns {Object.} JSON object - */ - BusinessIdentity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BusinessIdentity - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BusinessIdentity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.BusinessIdentity"; - }; - - BusinessIdentity.IdentityAttribute = (function() { - - /** - * Properties of an IdentityAttribute. - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @interface IIdentityAttribute - * @property {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration|null} [identityDeclaration] IdentityAttribute identityDeclaration - */ - - /** - * Constructs a new IdentityAttribute. - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity - * @classdesc Represents an IdentityAttribute. - * @implements IIdentityAttribute - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute=} [properties] Properties to set - */ - function IdentityAttribute(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]]; - } - - /** - * IdentityAttribute identityDeclaration. - * @member {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration} identityDeclaration - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @instance - */ - IdentityAttribute.prototype.identityDeclaration = 0; - - /** - * Creates a new IdentityAttribute instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @static - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute} IdentityAttribute instance - */ - IdentityAttribute.create = function create(properties) { - return new IdentityAttribute(properties); - }; - - /** - * Encodes the specified IdentityAttribute message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @static - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute} message IdentityAttribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityAttribute.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.identityDeclaration != null && Object.hasOwnProperty.call(message, "identityDeclaration")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.identityDeclaration); - return writer; - }; - - /** - * Encodes the specified IdentityAttribute message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @static - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IIdentityAttribute} message IdentityAttribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityAttribute.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityAttribute message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @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.BusinessIdentity.IdentityAttribute} IdentityAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityAttribute.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.BusinessIdentity.IdentityAttribute(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.identityDeclaration = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityAttribute message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute} IdentityAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityAttribute.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityAttribute message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityAttribute.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.identityDeclaration != null && message.hasOwnProperty("identityDeclaration")) - switch (message.identityDeclaration) { - default: - return "identityDeclaration: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an IdentityAttribute message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute} IdentityAttribute - */ - IdentityAttribute.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute(); - switch (object.identityDeclaration) { - default: - if (typeof object.identityDeclaration === "number") { - message.identityDeclaration = object.identityDeclaration; - break; - } - break; - case "IDENTITY_DECLARATION_UNSPECIFIED": - case 0: - message.identityDeclaration = 0; - break; - case "SELF_IDENTIFIES_AS": - case 1: - message.identityDeclaration = 1; - break; - case "DOES_NOT_SELF_IDENTIFY_AS": - case 2: - message.identityDeclaration = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an IdentityAttribute message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @static - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute} message IdentityAttribute - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityAttribute.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.identityDeclaration = options.enums === String ? "IDENTITY_DECLARATION_UNSPECIFIED" : 0; - if (message.identityDeclaration != null && message.hasOwnProperty("identityDeclaration")) - object.identityDeclaration = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration[message.identityDeclaration] === undefined ? message.identityDeclaration : $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration[message.identityDeclaration] : message.identityDeclaration; - return object; - }; - - /** - * Converts this IdentityAttribute to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @instance - * @returns {Object.} JSON object - */ - IdentityAttribute.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IdentityAttribute - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IdentityAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute"; - }; - - /** - * IdentityDeclaration enum. - * @name google.shopping.merchant.accounts.v1beta.BusinessIdentity.IdentityAttribute.IdentityDeclaration - * @enum {number} - * @property {number} IDENTITY_DECLARATION_UNSPECIFIED=0 IDENTITY_DECLARATION_UNSPECIFIED value - * @property {number} SELF_IDENTIFIES_AS=1 SELF_IDENTIFIES_AS value - * @property {number} DOES_NOT_SELF_IDENTIFY_AS=2 DOES_NOT_SELF_IDENTIFY_AS value - */ - IdentityAttribute.IdentityDeclaration = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDENTITY_DECLARATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "SELF_IDENTIFIES_AS"] = 1; - values[valuesById[2] = "DOES_NOT_SELF_IDENTIFY_AS"] = 2; - return values; - })(); - - return IdentityAttribute; - })(); - - /** - * PromotionsConsent enum. - * @name google.shopping.merchant.accounts.v1beta.BusinessIdentity.PromotionsConsent - * @enum {number} - * @property {number} PROMOTIONS_CONSENT_UNSPECIFIED=0 PROMOTIONS_CONSENT_UNSPECIFIED value - * @property {number} PROMOTIONS_CONSENT_GIVEN=1 PROMOTIONS_CONSENT_GIVEN value - * @property {number} PROMOTIONS_CONSENT_DENIED=2 PROMOTIONS_CONSENT_DENIED value - */ - BusinessIdentity.PromotionsConsent = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROMOTIONS_CONSENT_UNSPECIFIED"] = 0; - values[valuesById[1] = "PROMOTIONS_CONSENT_GIVEN"] = 1; - values[valuesById[2] = "PROMOTIONS_CONSENT_DENIED"] = 2; - return values; - })(); - - return BusinessIdentity; - })(); - - v1beta.GetBusinessIdentityRequest = (function() { - - /** - * Properties of a GetBusinessIdentityRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetBusinessIdentityRequest - * @property {string|null} [name] GetBusinessIdentityRequest name - */ - - /** - * Constructs a new GetBusinessIdentityRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetBusinessIdentityRequest. - * @implements IGetBusinessIdentityRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest=} [properties] Properties to set - */ - function GetBusinessIdentityRequest(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]]; - } - - /** - * GetBusinessIdentityRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @instance - */ - GetBusinessIdentityRequest.prototype.name = ""; - - /** - * Creates a new GetBusinessIdentityRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest} GetBusinessIdentityRequest instance - */ - GetBusinessIdentityRequest.create = function create(properties) { - return new GetBusinessIdentityRequest(properties); - }; - - /** - * Encodes the specified GetBusinessIdentityRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest} message GetBusinessIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBusinessIdentityRequest.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 GetBusinessIdentityRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest} message GetBusinessIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBusinessIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBusinessIdentityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @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.GetBusinessIdentityRequest} GetBusinessIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBusinessIdentityRequest.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.GetBusinessIdentityRequest(); - 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 GetBusinessIdentityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest} GetBusinessIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBusinessIdentityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBusinessIdentityRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBusinessIdentityRequest.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 GetBusinessIdentityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest} GetBusinessIdentityRequest - */ - GetBusinessIdentityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBusinessIdentityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest} message GetBusinessIdentityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBusinessIdentityRequest.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 GetBusinessIdentityRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @instance - * @returns {Object.} JSON object - */ - GetBusinessIdentityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBusinessIdentityRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBusinessIdentityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest"; - }; - - return GetBusinessIdentityRequest; - })(); - - v1beta.UpdateBusinessIdentityRequest = (function() { - - /** - * Properties of an UpdateBusinessIdentityRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUpdateBusinessIdentityRequest - * @property {google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null} [businessIdentity] UpdateBusinessIdentityRequest businessIdentity - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBusinessIdentityRequest updateMask - */ - - /** - * Constructs a new UpdateBusinessIdentityRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an UpdateBusinessIdentityRequest. - * @implements IUpdateBusinessIdentityRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest=} [properties] Properties to set - */ - function UpdateBusinessIdentityRequest(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]]; - } - - /** - * UpdateBusinessIdentityRequest businessIdentity. - * @member {google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null|undefined} businessIdentity - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @instance - */ - UpdateBusinessIdentityRequest.prototype.businessIdentity = null; - - /** - * UpdateBusinessIdentityRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @instance - */ - UpdateBusinessIdentityRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateBusinessIdentityRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest} UpdateBusinessIdentityRequest instance - */ - UpdateBusinessIdentityRequest.create = function create(properties) { - return new UpdateBusinessIdentityRequest(properties); - }; - - /** - * Encodes the specified UpdateBusinessIdentityRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest} message UpdateBusinessIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBusinessIdentityRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.businessIdentity != null && Object.hasOwnProperty.call(message, "businessIdentity")) - $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.encode(message.businessIdentity, 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 UpdateBusinessIdentityRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest} message UpdateBusinessIdentityRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBusinessIdentityRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBusinessIdentityRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @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.UpdateBusinessIdentityRequest} UpdateBusinessIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBusinessIdentityRequest.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.UpdateBusinessIdentityRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.businessIdentity = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.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 UpdateBusinessIdentityRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest} UpdateBusinessIdentityRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBusinessIdentityRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBusinessIdentityRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBusinessIdentityRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.businessIdentity != null && message.hasOwnProperty("businessIdentity")) { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.verify(message.businessIdentity); - if (error) - return "businessIdentity." + 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 UpdateBusinessIdentityRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest} UpdateBusinessIdentityRequest - */ - UpdateBusinessIdentityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest(); - if (object.businessIdentity != null) { - if (typeof object.businessIdentity !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.businessIdentity: object expected"); - message.businessIdentity = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.fromObject(object.businessIdentity); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateBusinessIdentityRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest} message UpdateBusinessIdentityRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBusinessIdentityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.businessIdentity = null; - object.updateMask = null; - } - if (message.businessIdentity != null && message.hasOwnProperty("businessIdentity")) - object.businessIdentity = $root.google.shopping.merchant.accounts.v1beta.BusinessIdentity.toObject(message.businessIdentity, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateBusinessIdentityRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBusinessIdentityRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBusinessIdentityRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBusinessIdentityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest"; - }; - - return UpdateBusinessIdentityRequest; - })(); - - v1beta.BusinessInfoService = (function() { - - /** - * Constructs a new BusinessInfoService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a BusinessInfoService - * @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 BusinessInfoService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (BusinessInfoService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BusinessInfoService; - - /** - * Creates new BusinessInfoService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService - * @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 {BusinessInfoService} RPC service. Useful where requests and/or responses are streamed. - */ - BusinessInfoService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessInfoService|getBusinessInfo}. - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService - * @typedef GetBusinessInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.BusinessInfo} [response] BusinessInfo - */ - - /** - * Calls GetBusinessInfo. - * @function getBusinessInfo - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest} request GetBusinessInfoRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.BusinessInfoService.GetBusinessInfoCallback} callback Node-style callback called with the error, if any, and BusinessInfo - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BusinessInfoService.prototype.getBusinessInfo = function getBusinessInfo(request, callback) { - return this.rpcCall(getBusinessInfo, $root.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest, $root.google.shopping.merchant.accounts.v1beta.BusinessInfo, request, callback); - }, "name", { value: "GetBusinessInfo" }); - - /** - * Calls GetBusinessInfo. - * @function getBusinessInfo - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest} request GetBusinessInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.BusinessInfoService|updateBusinessInfo}. - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService - * @typedef UpdateBusinessInfoCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.BusinessInfo} [response] BusinessInfo - */ - - /** - * Calls UpdateBusinessInfo. - * @function updateBusinessInfo - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest} request UpdateBusinessInfoRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.BusinessInfoService.UpdateBusinessInfoCallback} callback Node-style callback called with the error, if any, and BusinessInfo - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BusinessInfoService.prototype.updateBusinessInfo = function updateBusinessInfo(request, callback) { - return this.rpcCall(updateBusinessInfo, $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest, $root.google.shopping.merchant.accounts.v1beta.BusinessInfo, request, callback); - }, "name", { value: "UpdateBusinessInfo" }); - - /** - * Calls UpdateBusinessInfo. - * @function updateBusinessInfo - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfoService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest} request UpdateBusinessInfoRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return BusinessInfoService; - })(); - - v1beta.BusinessInfo = (function() { - - /** - * Properties of a BusinessInfo. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IBusinessInfo - * @property {string|null} [name] BusinessInfo name - * @property {google.type.IPostalAddress|null} [address] BusinessInfo address - * @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 - */ - - /** - * Constructs a new BusinessInfo. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a BusinessInfo. - * @implements IBusinessInfo - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IBusinessInfo=} [properties] Properties to set - */ - function BusinessInfo(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]]; - } - - /** - * BusinessInfo name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - */ - BusinessInfo.prototype.name = ""; - - /** - * BusinessInfo address. - * @member {google.type.IPostalAddress|null|undefined} address - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - */ - BusinessInfo.prototype.address = null; - - /** - * BusinessInfo phone. - * @member {google.type.IPhoneNumber|null|undefined} phone - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - */ - BusinessInfo.prototype.phone = null; - - /** - * BusinessInfo phoneVerificationState. - * @member {google.shopping.merchant.accounts.v1beta.PhoneVerificationState|null|undefined} phoneVerificationState - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - */ - BusinessInfo.prototype.phoneVerificationState = null; - - /** - * BusinessInfo customerService. - * @member {google.shopping.merchant.accounts.v1beta.ICustomerService|null|undefined} customerService - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - */ - 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; - - /** - * BusinessInfo _address. - * @member {"address"|undefined} _address - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - */ - Object.defineProperty(BusinessInfo.prototype, "_address", { - get: $util.oneOfGetter($oneOfFields = ["address"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * BusinessInfo _phone. - * @member {"phone"|undefined} _phone - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - */ - Object.defineProperty(BusinessInfo.prototype, "_phone", { - get: $util.oneOfGetter($oneOfFields = ["phone"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * BusinessInfo _phoneVerificationState. - * @member {"phoneVerificationState"|undefined} _phoneVerificationState - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - */ - Object.defineProperty(BusinessInfo.prototype, "_phoneVerificationState", { - get: $util.oneOfGetter($oneOfFields = ["phoneVerificationState"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * BusinessInfo _customerService. - * @member {"customerService"|undefined} _customerService - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - */ - Object.defineProperty(BusinessInfo.prototype, "_customerService", { - get: $util.oneOfGetter($oneOfFields = ["customerService"]), - 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 - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @static - * @param {google.shopping.merchant.accounts.v1beta.IBusinessInfo=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.BusinessInfo} BusinessInfo instance - */ - BusinessInfo.create = function create(properties) { - return new BusinessInfo(properties); - }; - - /** - * Encodes the specified BusinessInfo message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessInfo.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @static - * @param {google.shopping.merchant.accounts.v1beta.IBusinessInfo} message BusinessInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BusinessInfo.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.address != null && Object.hasOwnProperty.call(message, "address")) - $root.google.type.PostalAddress.encode(message.address, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.phone != null && Object.hasOwnProperty.call(message, "phone")) - $root.google.type.PhoneNumber.encode(message.phone, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.phoneVerificationState != null && Object.hasOwnProperty.call(message, "phoneVerificationState")) - 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; - }; - - /** - * Encodes the specified BusinessInfo message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @static - * @param {google.shopping.merchant.accounts.v1beta.IBusinessInfo} message BusinessInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BusinessInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BusinessInfo message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @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.BusinessInfo} BusinessInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BusinessInfo.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.BusinessInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.address = $root.google.type.PostalAddress.decode(reader, reader.uint32()); - break; - } - case 3: { - message.phone = $root.google.type.PhoneNumber.decode(reader, reader.uint32()); - break; - } - case 4: { - message.phoneVerificationState = reader.int32(); - break; - } - case 5: { - 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; - } - } - return message; - }; - - /** - * Decodes a BusinessInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.BusinessInfo} BusinessInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BusinessInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BusinessInfo message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BusinessInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.address != null && message.hasOwnProperty("address")) { - properties._address = 1; - { - var error = $root.google.type.PostalAddress.verify(message.address); - if (error) - return "address." + error; - } - } - if (message.phone != null && message.hasOwnProperty("phone")) { - properties._phone = 1; - { - var error = $root.google.type.PhoneNumber.verify(message.phone); - if (error) - return "phone." + error; - } - } - if (message.phoneVerificationState != null && message.hasOwnProperty("phoneVerificationState")) { - properties._phoneVerificationState = 1; - switch (message.phoneVerificationState) { - default: - return "phoneVerificationState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.customerService != null && message.hasOwnProperty("customerService")) { - properties._customerService = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.CustomerService.verify(message.customerService); - if (error) - return "customerService." + error; - } - } - if (message.koreanBusinessRegistrationNumber != null && message.hasOwnProperty("koreanBusinessRegistrationNumber")) { - properties._koreanBusinessRegistrationNumber = 1; - if (!$util.isString(message.koreanBusinessRegistrationNumber)) - return "koreanBusinessRegistrationNumber: string expected"; - } - return null; - }; - - /** - * Creates a BusinessInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.BusinessInfo} BusinessInfo - */ - BusinessInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.BusinessInfo) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.BusinessInfo(); - if (object.name != null) - message.name = String(object.name); - if (object.address != null) { - if (typeof object.address !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessInfo.address: object expected"); - message.address = $root.google.type.PostalAddress.fromObject(object.address); - } - if (object.phone != null) { - if (typeof object.phone !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessInfo.phone: object expected"); - message.phone = $root.google.type.PhoneNumber.fromObject(object.phone); - } - switch (object.phoneVerificationState) { - default: - if (typeof object.phoneVerificationState === "number") { - message.phoneVerificationState = object.phoneVerificationState; - break; - } - break; - case "PHONE_VERIFICATION_STATE_UNSPECIFIED": - case 0: - message.phoneVerificationState = 0; - break; - case "PHONE_VERIFICATION_STATE_VERIFIED": - case 1: - message.phoneVerificationState = 1; - break; - case "PHONE_VERIFICATION_STATE_UNVERIFIED": - case 2: - message.phoneVerificationState = 2; - break; - } - if (object.customerService != null) { - if (typeof object.customerService !== "object") - 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; - }; - - /** - * Creates a plain object from a BusinessInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @static - * @param {google.shopping.merchant.accounts.v1beta.BusinessInfo} message BusinessInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BusinessInfo.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; - if (message.address != null && message.hasOwnProperty("address")) { - object.address = $root.google.type.PostalAddress.toObject(message.address, options); - if (options.oneofs) - object._address = "address"; - } - if (message.phone != null && message.hasOwnProperty("phone")) { - object.phone = $root.google.type.PhoneNumber.toObject(message.phone, options); - if (options.oneofs) - object._phone = "phone"; - } - if (message.phoneVerificationState != null && message.hasOwnProperty("phoneVerificationState")) { - object.phoneVerificationState = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.PhoneVerificationState[message.phoneVerificationState] === undefined ? message.phoneVerificationState : $root.google.shopping.merchant.accounts.v1beta.PhoneVerificationState[message.phoneVerificationState] : message.phoneVerificationState; - if (options.oneofs) - object._phoneVerificationState = "phoneVerificationState"; - } - if (message.customerService != null && message.hasOwnProperty("customerService")) { - object.customerService = $root.google.shopping.merchant.accounts.v1beta.CustomerService.toObject(message.customerService, options); - 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; - }; - - /** - * Converts this BusinessInfo to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @instance - * @returns {Object.} JSON object - */ - BusinessInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BusinessInfo - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.BusinessInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BusinessInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.BusinessInfo"; - }; - - return BusinessInfo; - })(); - - v1beta.GetBusinessInfoRequest = (function() { - - /** - * Properties of a GetBusinessInfoRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetBusinessInfoRequest - * @property {string|null} [name] GetBusinessInfoRequest name - */ - - /** - * Constructs a new GetBusinessInfoRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetBusinessInfoRequest. - * @implements IGetBusinessInfoRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest=} [properties] Properties to set - */ - function GetBusinessInfoRequest(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]]; - } - - /** - * GetBusinessInfoRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @instance - */ - GetBusinessInfoRequest.prototype.name = ""; - - /** - * Creates a new GetBusinessInfoRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest} GetBusinessInfoRequest instance - */ - GetBusinessInfoRequest.create = function create(properties) { - return new GetBusinessInfoRequest(properties); - }; - - /** - * Encodes the specified GetBusinessInfoRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest} message GetBusinessInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBusinessInfoRequest.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 GetBusinessInfoRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest} message GetBusinessInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBusinessInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBusinessInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @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.GetBusinessInfoRequest} GetBusinessInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBusinessInfoRequest.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.GetBusinessInfoRequest(); - 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 GetBusinessInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest} GetBusinessInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBusinessInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBusinessInfoRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBusinessInfoRequest.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 GetBusinessInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest} GetBusinessInfoRequest - */ - GetBusinessInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBusinessInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest} message GetBusinessInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBusinessInfoRequest.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 GetBusinessInfoRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @instance - * @returns {Object.} JSON object - */ - GetBusinessInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBusinessInfoRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBusinessInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest"; - }; - - return GetBusinessInfoRequest; - })(); - - v1beta.UpdateBusinessInfoRequest = (function() { - - /** - * Properties of an UpdateBusinessInfoRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUpdateBusinessInfoRequest - * @property {google.shopping.merchant.accounts.v1beta.IBusinessInfo|null} [businessInfo] UpdateBusinessInfoRequest businessInfo - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBusinessInfoRequest updateMask - */ - - /** - * Constructs a new UpdateBusinessInfoRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an UpdateBusinessInfoRequest. - * @implements IUpdateBusinessInfoRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest=} [properties] Properties to set - */ - function UpdateBusinessInfoRequest(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]]; - } - - /** - * UpdateBusinessInfoRequest businessInfo. - * @member {google.shopping.merchant.accounts.v1beta.IBusinessInfo|null|undefined} businessInfo - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @instance - */ - UpdateBusinessInfoRequest.prototype.businessInfo = null; - - /** - * UpdateBusinessInfoRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @instance - */ - UpdateBusinessInfoRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateBusinessInfoRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest} UpdateBusinessInfoRequest instance - */ - UpdateBusinessInfoRequest.create = function create(properties) { - return new UpdateBusinessInfoRequest(properties); - }; - - /** - * Encodes the specified UpdateBusinessInfoRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest} message UpdateBusinessInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBusinessInfoRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.businessInfo != null && Object.hasOwnProperty.call(message, "businessInfo")) - $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.encode(message.businessInfo, 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 UpdateBusinessInfoRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest} message UpdateBusinessInfoRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBusinessInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBusinessInfoRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @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.UpdateBusinessInfoRequest} UpdateBusinessInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBusinessInfoRequest.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.UpdateBusinessInfoRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.businessInfo = $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.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 UpdateBusinessInfoRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest} UpdateBusinessInfoRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBusinessInfoRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBusinessInfoRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBusinessInfoRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.businessInfo != null && message.hasOwnProperty("businessInfo")) { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.verify(message.businessInfo); - if (error) - return "businessInfo." + 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 UpdateBusinessInfoRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest} UpdateBusinessInfoRequest - */ - UpdateBusinessInfoRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest(); - if (object.businessInfo != null) { - if (typeof object.businessInfo !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.businessInfo: object expected"); - message.businessInfo = $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.fromObject(object.businessInfo); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateBusinessInfoRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest} message UpdateBusinessInfoRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBusinessInfoRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.businessInfo = null; - object.updateMask = null; - } - if (message.businessInfo != null && message.hasOwnProperty("businessInfo")) - object.businessInfo = $root.google.shopping.merchant.accounts.v1beta.BusinessInfo.toObject(message.businessInfo, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateBusinessInfoRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBusinessInfoRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBusinessInfoRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBusinessInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest"; - }; - - return UpdateBusinessInfoRequest; - })(); - - v1beta.CustomerService = (function() { - - /** - * Properties of a CustomerService. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ICustomerService - * @property {string|null} [uri] CustomerService uri - * @property {string|null} [email] CustomerService email - * @property {google.type.IPhoneNumber|null} [phone] CustomerService phone - */ - - /** - * Constructs a new CustomerService. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a CustomerService. - * @implements ICustomerService - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ICustomerService=} [properties] Properties to set - */ - function CustomerService(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]]; - } - - /** - * CustomerService uri. - * @member {string|null|undefined} uri - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @instance - */ - CustomerService.prototype.uri = null; - - /** - * CustomerService email. - * @member {string|null|undefined} email - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @instance - */ - CustomerService.prototype.email = null; - - /** - * CustomerService phone. - * @member {google.type.IPhoneNumber|null|undefined} phone - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @instance - */ - CustomerService.prototype.phone = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CustomerService _uri. - * @member {"uri"|undefined} _uri - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @instance - */ - Object.defineProperty(CustomerService.prototype, "_uri", { - get: $util.oneOfGetter($oneOfFields = ["uri"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CustomerService _email. - * @member {"email"|undefined} _email - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @instance - */ - Object.defineProperty(CustomerService.prototype, "_email", { - get: $util.oneOfGetter($oneOfFields = ["email"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CustomerService _phone. - * @member {"phone"|undefined} _phone - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @instance - */ - Object.defineProperty(CustomerService.prototype, "_phone", { - get: $util.oneOfGetter($oneOfFields = ["phone"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CustomerService instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICustomerService=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.CustomerService} CustomerService instance - */ - CustomerService.create = function create(properties) { - return new CustomerService(properties); - }; - - /** - * Encodes the specified CustomerService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CustomerService.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICustomerService} message CustomerService message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomerService.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - if (message.email != null && Object.hasOwnProperty.call(message, "email")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); - if (message.phone != null && Object.hasOwnProperty.call(message, "phone")) - $root.google.type.PhoneNumber.encode(message.phone, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CustomerService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CustomerService.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICustomerService} message CustomerService message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomerService.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomerService message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @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.CustomerService} CustomerService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomerService.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.CustomerService(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.uri = reader.string(); - break; - } - case 2: { - message.email = reader.string(); - break; - } - case 3: { - message.phone = $root.google.type.PhoneNumber.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomerService message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.CustomerService} CustomerService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomerService.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomerService message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomerService.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties._uri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; - } - if (message.email != null && message.hasOwnProperty("email")) { - properties._email = 1; - if (!$util.isString(message.email)) - return "email: string expected"; - } - if (message.phone != null && message.hasOwnProperty("phone")) { - properties._phone = 1; - { - var error = $root.google.type.PhoneNumber.verify(message.phone); - if (error) - return "phone." + error; - } - } - return null; - }; - - /** - * Creates a CustomerService message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.CustomerService} CustomerService - */ - CustomerService.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CustomerService) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.CustomerService(); - if (object.uri != null) - message.uri = String(object.uri); - if (object.email != null) - message.email = String(object.email); - if (object.phone != null) { - if (typeof object.phone !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.CustomerService.phone: object expected"); - message.phone = $root.google.type.PhoneNumber.fromObject(object.phone); - } - return message; - }; - - /** - * Creates a plain object from a CustomerService message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @static - * @param {google.shopping.merchant.accounts.v1beta.CustomerService} message CustomerService - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomerService.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object._uri = "uri"; - } - if (message.email != null && message.hasOwnProperty("email")) { - object.email = message.email; - if (options.oneofs) - object._email = "email"; - } - if (message.phone != null && message.hasOwnProperty("phone")) { - object.phone = $root.google.type.PhoneNumber.toObject(message.phone, options); - if (options.oneofs) - object._phone = "phone"; - } - return object; - }; - - /** - * Converts this CustomerService to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @instance - * @returns {Object.} JSON object - */ - CustomerService.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomerService - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.CustomerService - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomerService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CustomerService"; - }; - - return CustomerService; - })(); - - /** - * PhoneVerificationState enum. - * @name google.shopping.merchant.accounts.v1beta.PhoneVerificationState - * @enum {number} - * @property {number} PHONE_VERIFICATION_STATE_UNSPECIFIED=0 PHONE_VERIFICATION_STATE_UNSPECIFIED value - * @property {number} PHONE_VERIFICATION_STATE_VERIFIED=1 PHONE_VERIFICATION_STATE_VERIFIED value - * @property {number} PHONE_VERIFICATION_STATE_UNVERIFIED=2 PHONE_VERIFICATION_STATE_UNVERIFIED value - */ - v1beta.PhoneVerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PHONE_VERIFICATION_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PHONE_VERIFICATION_STATE_VERIFIED"] = 1; - values[valuesById[2] = "PHONE_VERIFICATION_STATE_UNVERIFIED"] = 2; - return values; - })(); - - v1beta.EmailPreferencesService = (function() { - - /** - * Constructs a new EmailPreferencesService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an EmailPreferencesService - * @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 EmailPreferencesService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (EmailPreferencesService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EmailPreferencesService; - - /** - * Creates new EmailPreferencesService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService - * @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 {EmailPreferencesService} RPC service. Useful where requests and/or responses are streamed. - */ - EmailPreferencesService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.EmailPreferencesService|getEmailPreferences}. - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService - * @typedef GetEmailPreferencesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.EmailPreferences} [response] EmailPreferences - */ - - /** - * Calls GetEmailPreferences. - * @function getEmailPreferences - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest} request GetEmailPreferencesRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.EmailPreferencesService.GetEmailPreferencesCallback} callback Node-style callback called with the error, if any, and EmailPreferences - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EmailPreferencesService.prototype.getEmailPreferences = function getEmailPreferences(request, callback) { - return this.rpcCall(getEmailPreferences, $root.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest, $root.google.shopping.merchant.accounts.v1beta.EmailPreferences, request, callback); - }, "name", { value: "GetEmailPreferences" }); - - /** - * Calls GetEmailPreferences. - * @function getEmailPreferences - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest} request GetEmailPreferencesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.EmailPreferencesService|updateEmailPreferences}. - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService - * @typedef UpdateEmailPreferencesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.EmailPreferences} [response] EmailPreferences - */ - - /** - * Calls UpdateEmailPreferences. - * @function updateEmailPreferences - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest} request UpdateEmailPreferencesRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.EmailPreferencesService.UpdateEmailPreferencesCallback} callback Node-style callback called with the error, if any, and EmailPreferences - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EmailPreferencesService.prototype.updateEmailPreferences = function updateEmailPreferences(request, callback) { - return this.rpcCall(updateEmailPreferences, $root.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest, $root.google.shopping.merchant.accounts.v1beta.EmailPreferences, request, callback); - }, "name", { value: "UpdateEmailPreferences" }); - - /** - * Calls UpdateEmailPreferences. - * @function updateEmailPreferences - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferencesService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest} request UpdateEmailPreferencesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return EmailPreferencesService; - })(); - - v1beta.EmailPreferences = (function() { - - /** - * Properties of an EmailPreferences. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IEmailPreferences - * @property {string|null} [name] EmailPreferences name - * @property {google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState|null} [newsAndTips] EmailPreferences newsAndTips - */ - - /** - * Constructs a new EmailPreferences. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an EmailPreferences. - * @implements IEmailPreferences - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IEmailPreferences=} [properties] Properties to set - */ - function EmailPreferences(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]]; - } - - /** - * EmailPreferences name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @instance - */ - EmailPreferences.prototype.name = ""; - - /** - * EmailPreferences newsAndTips. - * @member {google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState} newsAndTips - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @instance - */ - EmailPreferences.prototype.newsAndTips = 0; - - /** - * Creates a new EmailPreferences instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @static - * @param {google.shopping.merchant.accounts.v1beta.IEmailPreferences=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.EmailPreferences} EmailPreferences instance - */ - EmailPreferences.create = function create(properties) { - return new EmailPreferences(properties); - }; - - /** - * Encodes the specified EmailPreferences message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EmailPreferences.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @static - * @param {google.shopping.merchant.accounts.v1beta.IEmailPreferences} message EmailPreferences message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmailPreferences.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.newsAndTips != null && Object.hasOwnProperty.call(message, "newsAndTips")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.newsAndTips); - return writer; - }; - - /** - * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EmailPreferences.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @static - * @param {google.shopping.merchant.accounts.v1beta.IEmailPreferences} message EmailPreferences message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmailPreferences.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EmailPreferences message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @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.EmailPreferences} EmailPreferences - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmailPreferences.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.EmailPreferences(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.newsAndTips = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.EmailPreferences} EmailPreferences - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmailPreferences.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EmailPreferences message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EmailPreferences.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.newsAndTips != null && message.hasOwnProperty("newsAndTips")) - switch (message.newsAndTips) { - default: - return "newsAndTips: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates an EmailPreferences message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.EmailPreferences} EmailPreferences - */ - EmailPreferences.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.EmailPreferences) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.EmailPreferences(); - if (object.name != null) - message.name = String(object.name); - switch (object.newsAndTips) { - default: - if (typeof object.newsAndTips === "number") { - message.newsAndTips = object.newsAndTips; - break; - } - break; - case "OPT_IN_STATE_UNSPECIFIED": - case 0: - message.newsAndTips = 0; - break; - case "OPTED_OUT": - case 1: - message.newsAndTips = 1; - break; - case "OPTED_IN": - case 2: - message.newsAndTips = 2; - break; - case "UNCONFIRMED": - case 3: - message.newsAndTips = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @static - * @param {google.shopping.merchant.accounts.v1beta.EmailPreferences} message EmailPreferences - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EmailPreferences.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.newsAndTips = options.enums === String ? "OPT_IN_STATE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.newsAndTips != null && message.hasOwnProperty("newsAndTips")) - object.newsAndTips = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState[message.newsAndTips] === undefined ? message.newsAndTips : $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState[message.newsAndTips] : message.newsAndTips; - return object; - }; - - /** - * Converts this EmailPreferences to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @instance - * @returns {Object.} JSON object - */ - EmailPreferences.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EmailPreferences - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.EmailPreferences - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EmailPreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.EmailPreferences"; - }; - - /** - * OptInState enum. - * @name google.shopping.merchant.accounts.v1beta.EmailPreferences.OptInState - * @enum {number} - * @property {number} OPT_IN_STATE_UNSPECIFIED=0 OPT_IN_STATE_UNSPECIFIED value - * @property {number} OPTED_OUT=1 OPTED_OUT value - * @property {number} OPTED_IN=2 OPTED_IN value - * @property {number} UNCONFIRMED=3 UNCONFIRMED value - */ - EmailPreferences.OptInState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPT_IN_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTED_OUT"] = 1; - values[valuesById[2] = "OPTED_IN"] = 2; - values[valuesById[3] = "UNCONFIRMED"] = 3; - return values; - })(); - - return EmailPreferences; - })(); - - v1beta.GetEmailPreferencesRequest = (function() { - - /** - * Properties of a GetEmailPreferencesRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetEmailPreferencesRequest - * @property {string|null} [name] GetEmailPreferencesRequest name - */ - - /** - * Constructs a new GetEmailPreferencesRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetEmailPreferencesRequest. - * @implements IGetEmailPreferencesRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest=} [properties] Properties to set - */ - function GetEmailPreferencesRequest(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]]; - } - - /** - * GetEmailPreferencesRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @instance - */ - GetEmailPreferencesRequest.prototype.name = ""; - - /** - * Creates a new GetEmailPreferencesRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest} GetEmailPreferencesRequest instance - */ - GetEmailPreferencesRequest.create = function create(properties) { - return new GetEmailPreferencesRequest(properties); - }; - - /** - * Encodes the specified GetEmailPreferencesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest} message GetEmailPreferencesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEmailPreferencesRequest.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 GetEmailPreferencesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest} message GetEmailPreferencesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEmailPreferencesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEmailPreferencesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @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.GetEmailPreferencesRequest} GetEmailPreferencesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEmailPreferencesRequest.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.GetEmailPreferencesRequest(); - 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 GetEmailPreferencesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest} GetEmailPreferencesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEmailPreferencesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEmailPreferencesRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEmailPreferencesRequest.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 GetEmailPreferencesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest} GetEmailPreferencesRequest - */ - GetEmailPreferencesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEmailPreferencesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest} message GetEmailPreferencesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEmailPreferencesRequest.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 GetEmailPreferencesRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @instance - * @returns {Object.} JSON object - */ - GetEmailPreferencesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEmailPreferencesRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEmailPreferencesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest"; - }; - - return GetEmailPreferencesRequest; - })(); - - v1beta.UpdateEmailPreferencesRequest = (function() { - - /** - * Properties of an UpdateEmailPreferencesRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUpdateEmailPreferencesRequest - * @property {google.shopping.merchant.accounts.v1beta.IEmailPreferences|null} [emailPreferences] UpdateEmailPreferencesRequest emailPreferences - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEmailPreferencesRequest updateMask - */ - - /** - * Constructs a new UpdateEmailPreferencesRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an UpdateEmailPreferencesRequest. - * @implements IUpdateEmailPreferencesRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest=} [properties] Properties to set - */ - function UpdateEmailPreferencesRequest(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]]; - } - - /** - * UpdateEmailPreferencesRequest emailPreferences. - * @member {google.shopping.merchant.accounts.v1beta.IEmailPreferences|null|undefined} emailPreferences - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @instance - */ - UpdateEmailPreferencesRequest.prototype.emailPreferences = null; - - /** - * UpdateEmailPreferencesRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @instance - */ - UpdateEmailPreferencesRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateEmailPreferencesRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest} UpdateEmailPreferencesRequest instance - */ - UpdateEmailPreferencesRequest.create = function create(properties) { - return new UpdateEmailPreferencesRequest(properties); - }; - - /** - * Encodes the specified UpdateEmailPreferencesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest} message UpdateEmailPreferencesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEmailPreferencesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.emailPreferences != null && Object.hasOwnProperty.call(message, "emailPreferences")) - $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.encode(message.emailPreferences, 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 UpdateEmailPreferencesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest} message UpdateEmailPreferencesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateEmailPreferencesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateEmailPreferencesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @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.UpdateEmailPreferencesRequest} UpdateEmailPreferencesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEmailPreferencesRequest.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.UpdateEmailPreferencesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.emailPreferences = $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.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 UpdateEmailPreferencesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest} UpdateEmailPreferencesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateEmailPreferencesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateEmailPreferencesRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateEmailPreferencesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) { - var error = $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.verify(message.emailPreferences); - if (error) - return "emailPreferences." + 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 UpdateEmailPreferencesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest} UpdateEmailPreferencesRequest - */ - UpdateEmailPreferencesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest(); - if (object.emailPreferences != null) { - if (typeof object.emailPreferences !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.emailPreferences: object expected"); - message.emailPreferences = $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.fromObject(object.emailPreferences); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateEmailPreferencesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest} message UpdateEmailPreferencesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateEmailPreferencesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.emailPreferences = null; - object.updateMask = null; - } - if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) - object.emailPreferences = $root.google.shopping.merchant.accounts.v1beta.EmailPreferences.toObject(message.emailPreferences, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateEmailPreferencesRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateEmailPreferencesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateEmailPreferencesRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateEmailPreferencesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest"; - }; - - return UpdateEmailPreferencesRequest; - })(); - - v1beta.HomepageService = (function() { - - /** - * Constructs a new HomepageService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a HomepageService - * @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 HomepageService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (HomepageService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = HomepageService; - - /** - * Creates new HomepageService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @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 {HomepageService} RPC service. Useful where requests and/or responses are streamed. - */ - HomepageService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|getHomepage}. - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @typedef GetHomepageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Homepage} [response] Homepage - */ - - /** - * Calls GetHomepage. - * @function getHomepage - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest} request GetHomepageRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.HomepageService.GetHomepageCallback} callback Node-style callback called with the error, if any, and Homepage - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(HomepageService.prototype.getHomepage = function getHomepage(request, callback) { - return this.rpcCall(getHomepage, $root.google.shopping.merchant.accounts.v1beta.GetHomepageRequest, $root.google.shopping.merchant.accounts.v1beta.Homepage, request, callback); - }, "name", { value: "GetHomepage" }); - - /** - * Calls GetHomepage. - * @function getHomepage - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest} request GetHomepageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|updateHomepage}. - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @typedef UpdateHomepageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Homepage} [response] Homepage - */ - - /** - * Calls UpdateHomepage. - * @function updateHomepage - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest} request UpdateHomepageRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.HomepageService.UpdateHomepageCallback} callback Node-style callback called with the error, if any, and Homepage - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(HomepageService.prototype.updateHomepage = function updateHomepage(request, callback) { - return this.rpcCall(updateHomepage, $root.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest, $root.google.shopping.merchant.accounts.v1beta.Homepage, request, callback); - }, "name", { value: "UpdateHomepage" }); - - /** - * Calls UpdateHomepage. - * @function updateHomepage - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest} request UpdateHomepageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|claimHomepage}. - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @typedef ClaimHomepageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Homepage} [response] Homepage - */ - - /** - * Calls ClaimHomepage. - * @function claimHomepage - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest} request ClaimHomepageRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.HomepageService.ClaimHomepageCallback} callback Node-style callback called with the error, if any, and Homepage - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(HomepageService.prototype.claimHomepage = function claimHomepage(request, callback) { - return this.rpcCall(claimHomepage, $root.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest, $root.google.shopping.merchant.accounts.v1beta.Homepage, request, callback); - }, "name", { value: "ClaimHomepage" }); - - /** - * Calls ClaimHomepage. - * @function claimHomepage - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest} request ClaimHomepageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.HomepageService|unclaimHomepage}. - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @typedef UnclaimHomepageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Homepage} [response] Homepage - */ - - /** - * Calls UnclaimHomepage. - * @function unclaimHomepage - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest} request UnclaimHomepageRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.HomepageService.UnclaimHomepageCallback} callback Node-style callback called with the error, if any, and Homepage - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(HomepageService.prototype.unclaimHomepage = function unclaimHomepage(request, callback) { - return this.rpcCall(unclaimHomepage, $root.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest, $root.google.shopping.merchant.accounts.v1beta.Homepage, request, callback); - }, "name", { value: "UnclaimHomepage" }); - - /** - * Calls UnclaimHomepage. - * @function unclaimHomepage - * @memberof google.shopping.merchant.accounts.v1beta.HomepageService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest} request UnclaimHomepageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return HomepageService; - })(); - - v1beta.Homepage = (function() { - - /** - * Properties of a Homepage. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IHomepage - * @property {string|null} [name] Homepage name - * @property {string|null} [uri] Homepage uri - * @property {boolean|null} [claimed] Homepage claimed - */ - - /** - * Constructs a new Homepage. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Homepage. - * @implements IHomepage - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IHomepage=} [properties] Properties to set - */ - function Homepage(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]]; - } - - /** - * Homepage name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @instance - */ - Homepage.prototype.name = ""; - - /** - * Homepage uri. - * @member {string|null|undefined} uri - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @instance - */ - Homepage.prototype.uri = null; - - /** - * Homepage claimed. - * @member {boolean} claimed - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @instance - */ - Homepage.prototype.claimed = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Homepage _uri. - * @member {"uri"|undefined} _uri - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @instance - */ - Object.defineProperty(Homepage.prototype, "_uri", { - get: $util.oneOfGetter($oneOfFields = ["uri"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Homepage instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @static - * @param {google.shopping.merchant.accounts.v1beta.IHomepage=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Homepage} Homepage instance - */ - Homepage.create = function create(properties) { - return new Homepage(properties); - }; - - /** - * Encodes the specified Homepage message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Homepage.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @static - * @param {google.shopping.merchant.accounts.v1beta.IHomepage} message Homepage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Homepage.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.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); - if (message.claimed != null && Object.hasOwnProperty.call(message, "claimed")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.claimed); - return writer; - }; - - /** - * Encodes the specified Homepage message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Homepage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @static - * @param {google.shopping.merchant.accounts.v1beta.IHomepage} message Homepage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Homepage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Homepage message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @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.Homepage} Homepage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Homepage.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.Homepage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uri = reader.string(); - break; - } - case 3: { - message.claimed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Homepage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Homepage} Homepage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Homepage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Homepage message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Homepage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) { - properties._uri = 1; - if (!$util.isString(message.uri)) - return "uri: string expected"; - } - if (message.claimed != null && message.hasOwnProperty("claimed")) - if (typeof message.claimed !== "boolean") - return "claimed: boolean expected"; - return null; - }; - - /** - * Creates a Homepage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Homepage} Homepage - */ - Homepage.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Homepage) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Homepage(); - if (object.name != null) - message.name = String(object.name); - if (object.uri != null) - message.uri = String(object.uri); - if (object.claimed != null) - message.claimed = Boolean(object.claimed); - return message; - }; - - /** - * Creates a plain object from a Homepage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @static - * @param {google.shopping.merchant.accounts.v1beta.Homepage} message Homepage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Homepage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.claimed = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uri != null && message.hasOwnProperty("uri")) { - object.uri = message.uri; - if (options.oneofs) - object._uri = "uri"; - } - if (message.claimed != null && message.hasOwnProperty("claimed")) - object.claimed = message.claimed; - return object; - }; - - /** - * Converts this Homepage to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @instance - * @returns {Object.} JSON object - */ - Homepage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Homepage - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Homepage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Homepage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Homepage"; - }; - - return Homepage; - })(); - - v1beta.GetHomepageRequest = (function() { - - /** - * Properties of a GetHomepageRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetHomepageRequest - * @property {string|null} [name] GetHomepageRequest name - */ - - /** - * Constructs a new GetHomepageRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetHomepageRequest. - * @implements IGetHomepageRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest=} [properties] Properties to set - */ - function GetHomepageRequest(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]]; - } - - /** - * GetHomepageRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @instance - */ - GetHomepageRequest.prototype.name = ""; - - /** - * Creates a new GetHomepageRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetHomepageRequest} GetHomepageRequest instance - */ - GetHomepageRequest.create = function create(properties) { - return new GetHomepageRequest(properties); - }; - - /** - * Encodes the specified GetHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetHomepageRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest} message GetHomepageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetHomepageRequest.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 GetHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetHomepageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetHomepageRequest} message GetHomepageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetHomepageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetHomepageRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @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.GetHomepageRequest} GetHomepageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetHomepageRequest.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.GetHomepageRequest(); - 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 GetHomepageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetHomepageRequest} GetHomepageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetHomepageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetHomepageRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetHomepageRequest.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 GetHomepageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetHomepageRequest} GetHomepageRequest - */ - GetHomepageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetHomepageRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetHomepageRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetHomepageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetHomepageRequest} message GetHomepageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetHomepageRequest.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 GetHomepageRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @instance - * @returns {Object.} JSON object - */ - GetHomepageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetHomepageRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetHomepageRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetHomepageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetHomepageRequest"; - }; - - return GetHomepageRequest; - })(); - - v1beta.UpdateHomepageRequest = (function() { - - /** - * Properties of an UpdateHomepageRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUpdateHomepageRequest - * @property {google.shopping.merchant.accounts.v1beta.IHomepage|null} [homepage] UpdateHomepageRequest homepage - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateHomepageRequest updateMask - */ - - /** - * Constructs a new UpdateHomepageRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an UpdateHomepageRequest. - * @implements IUpdateHomepageRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest=} [properties] Properties to set - */ - function UpdateHomepageRequest(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]]; - } - - /** - * UpdateHomepageRequest homepage. - * @member {google.shopping.merchant.accounts.v1beta.IHomepage|null|undefined} homepage - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @instance - */ - UpdateHomepageRequest.prototype.homepage = null; - - /** - * UpdateHomepageRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @instance - */ - UpdateHomepageRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateHomepageRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest} UpdateHomepageRequest instance - */ - UpdateHomepageRequest.create = function create(properties) { - return new UpdateHomepageRequest(properties); - }; - - /** - * Encodes the specified UpdateHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest} message UpdateHomepageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateHomepageRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.homepage != null && Object.hasOwnProperty.call(message, "homepage")) - $root.google.shopping.merchant.accounts.v1beta.Homepage.encode(message.homepage, 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 UpdateHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest} message UpdateHomepageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateHomepageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateHomepageRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @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.UpdateHomepageRequest} UpdateHomepageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateHomepageRequest.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.UpdateHomepageRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.homepage = $root.google.shopping.merchant.accounts.v1beta.Homepage.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 UpdateHomepageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest} UpdateHomepageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateHomepageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateHomepageRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateHomepageRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.homepage != null && message.hasOwnProperty("homepage")) { - var error = $root.google.shopping.merchant.accounts.v1beta.Homepage.verify(message.homepage); - if (error) - return "homepage." + 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 UpdateHomepageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest} UpdateHomepageRequest - */ - UpdateHomepageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest(); - if (object.homepage != null) { - if (typeof object.homepage !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.homepage: object expected"); - message.homepage = $root.google.shopping.merchant.accounts.v1beta.Homepage.fromObject(object.homepage); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateHomepageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest} message UpdateHomepageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateHomepageRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.homepage = null; - object.updateMask = null; - } - if (message.homepage != null && message.hasOwnProperty("homepage")) - object.homepage = $root.google.shopping.merchant.accounts.v1beta.Homepage.toObject(message.homepage, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateHomepageRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateHomepageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateHomepageRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateHomepageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest"; - }; - - return UpdateHomepageRequest; - })(); - - v1beta.ClaimHomepageRequest = (function() { - - /** - * Properties of a ClaimHomepageRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IClaimHomepageRequest - * @property {string|null} [name] ClaimHomepageRequest name - */ - - /** - * Constructs a new ClaimHomepageRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ClaimHomepageRequest. - * @implements IClaimHomepageRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest=} [properties] Properties to set - */ - function ClaimHomepageRequest(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]]; - } - - /** - * ClaimHomepageRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @instance - */ - ClaimHomepageRequest.prototype.name = ""; - - /** - * Creates a new ClaimHomepageRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest} ClaimHomepageRequest instance - */ - ClaimHomepageRequest.create = function create(properties) { - return new ClaimHomepageRequest(properties); - }; - - /** - * Encodes the specified ClaimHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest} message ClaimHomepageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClaimHomepageRequest.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 ClaimHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest} message ClaimHomepageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClaimHomepageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClaimHomepageRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @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.ClaimHomepageRequest} ClaimHomepageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClaimHomepageRequest.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.ClaimHomepageRequest(); - 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 ClaimHomepageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest} ClaimHomepageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClaimHomepageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClaimHomepageRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClaimHomepageRequest.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 ClaimHomepageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest} ClaimHomepageRequest - */ - ClaimHomepageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a ClaimHomepageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest} message ClaimHomepageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClaimHomepageRequest.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 ClaimHomepageRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @instance - * @returns {Object.} JSON object - */ - ClaimHomepageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClaimHomepageRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClaimHomepageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest"; - }; - - return ClaimHomepageRequest; - })(); - - v1beta.UnclaimHomepageRequest = (function() { - - /** - * Properties of an UnclaimHomepageRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUnclaimHomepageRequest - * @property {string|null} [name] UnclaimHomepageRequest name - */ - - /** - * Constructs a new UnclaimHomepageRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an UnclaimHomepageRequest. - * @implements IUnclaimHomepageRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest=} [properties] Properties to set - */ - function UnclaimHomepageRequest(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]]; - } - - /** - * UnclaimHomepageRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @instance - */ - UnclaimHomepageRequest.prototype.name = ""; - - /** - * Creates a new UnclaimHomepageRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest} UnclaimHomepageRequest instance - */ - UnclaimHomepageRequest.create = function create(properties) { - return new UnclaimHomepageRequest(properties); - }; - - /** - * Encodes the specified UnclaimHomepageRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest} message UnclaimHomepageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnclaimHomepageRequest.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 UnclaimHomepageRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest} message UnclaimHomepageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnclaimHomepageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UnclaimHomepageRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @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.UnclaimHomepageRequest} UnclaimHomepageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnclaimHomepageRequest.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.UnclaimHomepageRequest(); - 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 an UnclaimHomepageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest} UnclaimHomepageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnclaimHomepageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UnclaimHomepageRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UnclaimHomepageRequest.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 an UnclaimHomepageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest} UnclaimHomepageRequest - */ - UnclaimHomepageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an UnclaimHomepageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest} message UnclaimHomepageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UnclaimHomepageRequest.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 UnclaimHomepageRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @instance - * @returns {Object.} JSON object - */ - UnclaimHomepageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UnclaimHomepageRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UnclaimHomepageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest"; - }; - - return UnclaimHomepageRequest; - })(); - - v1beta.OnlineReturnPolicyService = (function() { - - /** - * Constructs a new OnlineReturnPolicyService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an OnlineReturnPolicyService - * @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 OnlineReturnPolicyService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (OnlineReturnPolicyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = OnlineReturnPolicyService; - - /** - * Creates new OnlineReturnPolicyService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService - * @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 {OnlineReturnPolicyService} RPC service. Useful where requests and/or responses are streamed. - */ - OnlineReturnPolicyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService|getOnlineReturnPolicy}. - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService - * @typedef GetOnlineReturnPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} [response] OnlineReturnPolicy - */ - - /** - * Calls GetOnlineReturnPolicy. - * @function getOnlineReturnPolicy - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest} request GetOnlineReturnPolicyRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.GetOnlineReturnPolicyCallback} callback Node-style callback called with the error, if any, and OnlineReturnPolicy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(OnlineReturnPolicyService.prototype.getOnlineReturnPolicy = function getOnlineReturnPolicy(request, callback) { - return this.rpcCall(getOnlineReturnPolicy, $root.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest, $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy, request, callback); - }, "name", { value: "GetOnlineReturnPolicy" }); - - /** - * Calls GetOnlineReturnPolicy. - * @function getOnlineReturnPolicy - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest} request GetOnlineReturnPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService|listOnlineReturnPolicies}. - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService - * @typedef ListOnlineReturnPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} [response] ListOnlineReturnPoliciesResponse - */ - - /** - * Calls ListOnlineReturnPolicies. - * @function listOnlineReturnPolicies - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest} request ListOnlineReturnPoliciesRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.ListOnlineReturnPoliciesCallback} callback Node-style callback called with the error, if any, and ListOnlineReturnPoliciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(OnlineReturnPolicyService.prototype.listOnlineReturnPolicies = function listOnlineReturnPolicies(request, callback) { - return this.rpcCall(listOnlineReturnPolicies, $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest, $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse, request, callback); - }, "name", { value: "ListOnlineReturnPolicies" }); - - /** - * Calls ListOnlineReturnPolicies. - * @function listOnlineReturnPolicies - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest} request ListOnlineReturnPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return OnlineReturnPolicyService; - })(); - - v1beta.GetOnlineReturnPolicyRequest = (function() { - - /** - * Properties of a GetOnlineReturnPolicyRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetOnlineReturnPolicyRequest - * @property {string|null} [name] GetOnlineReturnPolicyRequest name - */ - - /** - * Constructs a new GetOnlineReturnPolicyRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetOnlineReturnPolicyRequest. - * @implements IGetOnlineReturnPolicyRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest=} [properties] Properties to set - */ - function GetOnlineReturnPolicyRequest(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]]; - } - - /** - * GetOnlineReturnPolicyRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @instance - */ - GetOnlineReturnPolicyRequest.prototype.name = ""; - - /** - * Creates a new GetOnlineReturnPolicyRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest} GetOnlineReturnPolicyRequest instance - */ - GetOnlineReturnPolicyRequest.create = function create(properties) { - return new GetOnlineReturnPolicyRequest(properties); - }; - - /** - * Encodes the specified GetOnlineReturnPolicyRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest} message GetOnlineReturnPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOnlineReturnPolicyRequest.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 GetOnlineReturnPolicyRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest} message GetOnlineReturnPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOnlineReturnPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOnlineReturnPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @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.GetOnlineReturnPolicyRequest} GetOnlineReturnPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOnlineReturnPolicyRequest.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.GetOnlineReturnPolicyRequest(); - 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 GetOnlineReturnPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest} GetOnlineReturnPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOnlineReturnPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOnlineReturnPolicyRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOnlineReturnPolicyRequest.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 GetOnlineReturnPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest} GetOnlineReturnPolicyRequest - */ - GetOnlineReturnPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOnlineReturnPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest} message GetOnlineReturnPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOnlineReturnPolicyRequest.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 GetOnlineReturnPolicyRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - GetOnlineReturnPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOnlineReturnPolicyRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOnlineReturnPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest"; - }; - - return GetOnlineReturnPolicyRequest; - })(); - - v1beta.ListOnlineReturnPoliciesRequest = (function() { - - /** - * Properties of a ListOnlineReturnPoliciesRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListOnlineReturnPoliciesRequest - * @property {string|null} [parent] ListOnlineReturnPoliciesRequest parent - * @property {number|null} [pageSize] ListOnlineReturnPoliciesRequest pageSize - * @property {string|null} [pageToken] ListOnlineReturnPoliciesRequest pageToken - */ - - /** - * Constructs a new ListOnlineReturnPoliciesRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListOnlineReturnPoliciesRequest. - * @implements IListOnlineReturnPoliciesRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest=} [properties] Properties to set - */ - function ListOnlineReturnPoliciesRequest(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]]; - } - - /** - * ListOnlineReturnPoliciesRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @instance - */ - ListOnlineReturnPoliciesRequest.prototype.parent = ""; - - /** - * ListOnlineReturnPoliciesRequest pageSize. - * @member {number} pageSize - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @instance - */ - ListOnlineReturnPoliciesRequest.prototype.pageSize = 0; - - /** - * ListOnlineReturnPoliciesRequest pageToken. - * @member {string} pageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @instance - */ - ListOnlineReturnPoliciesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOnlineReturnPoliciesRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest} ListOnlineReturnPoliciesRequest instance - */ - ListOnlineReturnPoliciesRequest.create = function create(properties) { - return new ListOnlineReturnPoliciesRequest(properties); - }; - - /** - * Encodes the specified ListOnlineReturnPoliciesRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest} message ListOnlineReturnPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOnlineReturnPoliciesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListOnlineReturnPoliciesRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest} message ListOnlineReturnPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOnlineReturnPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOnlineReturnPoliciesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @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.ListOnlineReturnPoliciesRequest} ListOnlineReturnPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOnlineReturnPoliciesRequest.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.ListOnlineReturnPoliciesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOnlineReturnPoliciesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest} ListOnlineReturnPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOnlineReturnPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOnlineReturnPoliciesRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOnlineReturnPoliciesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOnlineReturnPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest} ListOnlineReturnPoliciesRequest - */ - ListOnlineReturnPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOnlineReturnPoliciesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest} message ListOnlineReturnPoliciesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOnlineReturnPoliciesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListOnlineReturnPoliciesRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @instance - * @returns {Object.} JSON object - */ - ListOnlineReturnPoliciesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOnlineReturnPoliciesRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOnlineReturnPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest"; - }; - - return ListOnlineReturnPoliciesRequest; - })(); - - v1beta.ListOnlineReturnPoliciesResponse = (function() { - - /** - * Properties of a ListOnlineReturnPoliciesResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListOnlineReturnPoliciesResponse - * @property {Array.|null} [onlineReturnPolicies] ListOnlineReturnPoliciesResponse onlineReturnPolicies - * @property {string|null} [nextPageToken] ListOnlineReturnPoliciesResponse nextPageToken - */ - - /** - * Constructs a new ListOnlineReturnPoliciesResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListOnlineReturnPoliciesResponse. - * @implements IListOnlineReturnPoliciesResponse - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse=} [properties] Properties to set - */ - function ListOnlineReturnPoliciesResponse(properties) { - this.onlineReturnPolicies = []; - 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]]; - } - - /** - * ListOnlineReturnPoliciesResponse onlineReturnPolicies. - * @member {Array.} onlineReturnPolicies - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @instance - */ - ListOnlineReturnPoliciesResponse.prototype.onlineReturnPolicies = $util.emptyArray; - - /** - * ListOnlineReturnPoliciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @instance - */ - ListOnlineReturnPoliciesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOnlineReturnPoliciesResponse instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} ListOnlineReturnPoliciesResponse instance - */ - ListOnlineReturnPoliciesResponse.create = function create(properties) { - return new ListOnlineReturnPoliciesResponse(properties); - }; - - /** - * Encodes the specified ListOnlineReturnPoliciesResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse} message ListOnlineReturnPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOnlineReturnPoliciesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.onlineReturnPolicies != null && message.onlineReturnPolicies.length) - for (var i = 0; i < message.onlineReturnPolicies.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.encode(message.onlineReturnPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOnlineReturnPoliciesResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse} message ListOnlineReturnPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOnlineReturnPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOnlineReturnPoliciesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @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.ListOnlineReturnPoliciesResponse} ListOnlineReturnPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOnlineReturnPoliciesResponse.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.ListOnlineReturnPoliciesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.onlineReturnPolicies && message.onlineReturnPolicies.length)) - message.onlineReturnPolicies = []; - message.onlineReturnPolicies.push($root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListOnlineReturnPoliciesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} ListOnlineReturnPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOnlineReturnPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOnlineReturnPoliciesResponse message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOnlineReturnPoliciesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.onlineReturnPolicies != null && message.hasOwnProperty("onlineReturnPolicies")) { - if (!Array.isArray(message.onlineReturnPolicies)) - return "onlineReturnPolicies: array expected"; - for (var i = 0; i < message.onlineReturnPolicies.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify(message.onlineReturnPolicies[i]); - if (error) - return "onlineReturnPolicies." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOnlineReturnPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} ListOnlineReturnPoliciesResponse - */ - ListOnlineReturnPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse(); - if (object.onlineReturnPolicies) { - if (!Array.isArray(object.onlineReturnPolicies)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.onlineReturnPolicies: array expected"); - message.onlineReturnPolicies = []; - for (var i = 0; i < object.onlineReturnPolicies.length; ++i) { - if (typeof object.onlineReturnPolicies[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.onlineReturnPolicies: object expected"); - message.onlineReturnPolicies[i] = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.fromObject(object.onlineReturnPolicies[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOnlineReturnPoliciesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse} message ListOnlineReturnPoliciesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOnlineReturnPoliciesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.onlineReturnPolicies = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.onlineReturnPolicies && message.onlineReturnPolicies.length) { - object.onlineReturnPolicies = []; - for (var j = 0; j < message.onlineReturnPolicies.length; ++j) - object.onlineReturnPolicies[j] = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.toObject(message.onlineReturnPolicies[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOnlineReturnPoliciesResponse to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @instance - * @returns {Object.} JSON object - */ - ListOnlineReturnPoliciesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOnlineReturnPoliciesResponse - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOnlineReturnPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse"; - }; - - return ListOnlineReturnPoliciesResponse; - })(); - - v1beta.OnlineReturnPolicy = (function() { - - /** - * Properties of an OnlineReturnPolicy. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IOnlineReturnPolicy - * @property {string|null} [name] OnlineReturnPolicy name - * @property {string|null} [returnPolicyId] OnlineReturnPolicy returnPolicyId - * @property {string|null} [label] OnlineReturnPolicy label - * @property {Array.|null} [countries] OnlineReturnPolicy countries - * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy|null} [policy] OnlineReturnPolicy policy - * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee|null} [restockingFee] OnlineReturnPolicy restockingFee - * @property {Array.|null} [returnMethods] OnlineReturnPolicy returnMethods - * @property {Array.|null} [itemConditions] OnlineReturnPolicy itemConditions - * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee|null} [returnShippingFee] OnlineReturnPolicy returnShippingFee - * @property {string|null} [returnPolicyUri] OnlineReturnPolicy returnPolicyUri - * @property {boolean|null} [acceptDefectiveOnly] OnlineReturnPolicy acceptDefectiveOnly - * @property {number|null} [processRefundDays] OnlineReturnPolicy processRefundDays - * @property {boolean|null} [acceptExchange] OnlineReturnPolicy acceptExchange - */ - - /** - * Constructs a new OnlineReturnPolicy. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an OnlineReturnPolicy. - * @implements IOnlineReturnPolicy - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy=} [properties] Properties to set - */ - function OnlineReturnPolicy(properties) { - this.countries = []; - this.returnMethods = []; - this.itemConditions = []; - 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]]; - } - - /** - * OnlineReturnPolicy name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.name = ""; - - /** - * OnlineReturnPolicy returnPolicyId. - * @member {string} returnPolicyId - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.returnPolicyId = ""; - - /** - * OnlineReturnPolicy label. - * @member {string} label - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.label = ""; - - /** - * OnlineReturnPolicy countries. - * @member {Array.} countries - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.countries = $util.emptyArray; - - /** - * OnlineReturnPolicy policy. - * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy|null|undefined} policy - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.policy = null; - - /** - * OnlineReturnPolicy restockingFee. - * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee|null|undefined} restockingFee - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.restockingFee = null; - - /** - * OnlineReturnPolicy returnMethods. - * @member {Array.} returnMethods - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.returnMethods = $util.emptyArray; - - /** - * OnlineReturnPolicy itemConditions. - * @member {Array.} itemConditions - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.itemConditions = $util.emptyArray; - - /** - * OnlineReturnPolicy returnShippingFee. - * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee|null|undefined} returnShippingFee - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.returnShippingFee = null; - - /** - * OnlineReturnPolicy returnPolicyUri. - * @member {string} returnPolicyUri - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.returnPolicyUri = ""; - - /** - * OnlineReturnPolicy acceptDefectiveOnly. - * @member {boolean|null|undefined} acceptDefectiveOnly - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.acceptDefectiveOnly = null; - - /** - * OnlineReturnPolicy processRefundDays. - * @member {number|null|undefined} processRefundDays - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.processRefundDays = null; - - /** - * OnlineReturnPolicy acceptExchange. - * @member {boolean|null|undefined} acceptExchange - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - OnlineReturnPolicy.prototype.acceptExchange = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OnlineReturnPolicy _acceptDefectiveOnly. - * @member {"acceptDefectiveOnly"|undefined} _acceptDefectiveOnly - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - Object.defineProperty(OnlineReturnPolicy.prototype, "_acceptDefectiveOnly", { - get: $util.oneOfGetter($oneOfFields = ["acceptDefectiveOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * OnlineReturnPolicy _processRefundDays. - * @member {"processRefundDays"|undefined} _processRefundDays - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - Object.defineProperty(OnlineReturnPolicy.prototype, "_processRefundDays", { - get: $util.oneOfGetter($oneOfFields = ["processRefundDays"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * OnlineReturnPolicy _acceptExchange. - * @member {"acceptExchange"|undefined} _acceptExchange - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - */ - Object.defineProperty(OnlineReturnPolicy.prototype, "_acceptExchange", { - get: $util.oneOfGetter($oneOfFields = ["acceptExchange"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new OnlineReturnPolicy instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @static - * @param {google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} OnlineReturnPolicy instance - */ - OnlineReturnPolicy.create = function create(properties) { - return new OnlineReturnPolicy(properties); - }; - - /** - * Encodes the specified OnlineReturnPolicy message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @static - * @param {google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy} message OnlineReturnPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OnlineReturnPolicy.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.returnPolicyId != null && Object.hasOwnProperty.call(message, "returnPolicyId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.returnPolicyId); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.label); - if (message.countries != null && message.countries.length) - for (var i = 0; i < message.countries.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.countries[i]); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.encode(message.policy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.restockingFee != null && Object.hasOwnProperty.call(message, "restockingFee")) - $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.encode(message.restockingFee, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.returnMethods != null && message.returnMethods.length) { - writer.uint32(/* id 7, wireType 2 =*/58).fork(); - for (var i = 0; i < message.returnMethods.length; ++i) - writer.int32(message.returnMethods[i]); - writer.ldelim(); - } - if (message.itemConditions != null && message.itemConditions.length) { - writer.uint32(/* id 8, wireType 2 =*/66).fork(); - for (var i = 0; i < message.itemConditions.length; ++i) - writer.int32(message.itemConditions[i]); - writer.ldelim(); - } - if (message.returnShippingFee != null && Object.hasOwnProperty.call(message, "returnShippingFee")) - $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.encode(message.returnShippingFee, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.returnPolicyUri != null && Object.hasOwnProperty.call(message, "returnPolicyUri")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.returnPolicyUri); - if (message.acceptDefectiveOnly != null && Object.hasOwnProperty.call(message, "acceptDefectiveOnly")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.acceptDefectiveOnly); - if (message.processRefundDays != null && Object.hasOwnProperty.call(message, "processRefundDays")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.processRefundDays); - if (message.acceptExchange != null && Object.hasOwnProperty.call(message, "acceptExchange")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.acceptExchange); - return writer; - }; - - /** - * Encodes the specified OnlineReturnPolicy message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @static - * @param {google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy} message OnlineReturnPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OnlineReturnPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OnlineReturnPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @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.OnlineReturnPolicy} OnlineReturnPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OnlineReturnPolicy.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.OnlineReturnPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.returnPolicyId = reader.string(); - break; - } - case 3: { - message.label = reader.string(); - break; - } - case 4: { - if (!(message.countries && message.countries.length)) - message.countries = []; - message.countries.push(reader.string()); - break; - } - case 5: { - message.policy = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.decode(reader, reader.uint32()); - break; - } - case 6: { - message.restockingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.decode(reader, reader.uint32()); - break; - } - case 7: { - if (!(message.returnMethods && message.returnMethods.length)) - message.returnMethods = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.returnMethods.push(reader.int32()); - } else - message.returnMethods.push(reader.int32()); - break; - } - case 8: { - if (!(message.itemConditions && message.itemConditions.length)) - message.itemConditions = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.itemConditions.push(reader.int32()); - } else - message.itemConditions.push(reader.int32()); - break; - } - case 9: { - message.returnShippingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.decode(reader, reader.uint32()); - break; - } - case 10: { - message.returnPolicyUri = reader.string(); - break; - } - case 11: { - message.acceptDefectiveOnly = reader.bool(); - break; - } - case 12: { - message.processRefundDays = reader.int32(); - break; - } - case 13: { - message.acceptExchange = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OnlineReturnPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} OnlineReturnPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OnlineReturnPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OnlineReturnPolicy message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OnlineReturnPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.returnPolicyId != null && message.hasOwnProperty("returnPolicyId")) - if (!$util.isString(message.returnPolicyId)) - return "returnPolicyId: string expected"; - if (message.label != null && message.hasOwnProperty("label")) - if (!$util.isString(message.label)) - return "label: string expected"; - if (message.countries != null && message.hasOwnProperty("countries")) { - if (!Array.isArray(message.countries)) - return "countries: array expected"; - for (var i = 0; i < message.countries.length; ++i) - if (!$util.isString(message.countries[i])) - return "countries: string[] expected"; - } - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify(message.policy); - if (error) - return "policy." + error; - } - if (message.restockingFee != null && message.hasOwnProperty("restockingFee")) { - var error = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify(message.restockingFee); - if (error) - return "restockingFee." + error; - } - if (message.returnMethods != null && message.hasOwnProperty("returnMethods")) { - if (!Array.isArray(message.returnMethods)) - return "returnMethods: array expected"; - for (var i = 0; i < message.returnMethods.length; ++i) - switch (message.returnMethods[i]) { - default: - return "returnMethods: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.itemConditions != null && message.hasOwnProperty("itemConditions")) { - if (!Array.isArray(message.itemConditions)) - return "itemConditions: array expected"; - for (var i = 0; i < message.itemConditions.length; ++i) - switch (message.itemConditions[i]) { - default: - return "itemConditions: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.returnShippingFee != null && message.hasOwnProperty("returnShippingFee")) { - var error = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify(message.returnShippingFee); - if (error) - return "returnShippingFee." + error; - } - if (message.returnPolicyUri != null && message.hasOwnProperty("returnPolicyUri")) - if (!$util.isString(message.returnPolicyUri)) - return "returnPolicyUri: string expected"; - if (message.acceptDefectiveOnly != null && message.hasOwnProperty("acceptDefectiveOnly")) { - properties._acceptDefectiveOnly = 1; - if (typeof message.acceptDefectiveOnly !== "boolean") - return "acceptDefectiveOnly: boolean expected"; - } - if (message.processRefundDays != null && message.hasOwnProperty("processRefundDays")) { - properties._processRefundDays = 1; - if (!$util.isInteger(message.processRefundDays)) - return "processRefundDays: integer expected"; - } - if (message.acceptExchange != null && message.hasOwnProperty("acceptExchange")) { - properties._acceptExchange = 1; - if (typeof message.acceptExchange !== "boolean") - return "acceptExchange: boolean expected"; - } - return null; - }; - - /** - * Creates an OnlineReturnPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} OnlineReturnPolicy - */ - OnlineReturnPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy(); - if (object.name != null) - message.name = String(object.name); - if (object.returnPolicyId != null) - message.returnPolicyId = String(object.returnPolicyId); - if (object.label != null) - message.label = String(object.label); - if (object.countries) { - if (!Array.isArray(object.countries)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.countries: array expected"); - message.countries = []; - for (var i = 0; i < object.countries.length; ++i) - message.countries[i] = String(object.countries[i]); - } - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.policy: object expected"); - message.policy = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.fromObject(object.policy); - } - if (object.restockingFee != null) { - if (typeof object.restockingFee !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.restockingFee: object expected"); - message.restockingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.fromObject(object.restockingFee); - } - if (object.returnMethods) { - if (!Array.isArray(object.returnMethods)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.returnMethods: array expected"); - message.returnMethods = []; - for (var i = 0; i < object.returnMethods.length; ++i) - switch (object.returnMethods[i]) { - default: - if (typeof object.returnMethods[i] === "number") { - message.returnMethods[i] = object.returnMethods[i]; - break; - } - case "RETURN_METHOD_UNSPECIFIED": - case 0: - message.returnMethods[i] = 0; - break; - case "BY_MAIL": - case 1: - message.returnMethods[i] = 1; - break; - case "IN_STORE": - case 2: - message.returnMethods[i] = 2; - break; - case "AT_A_KIOSK": - case 3: - message.returnMethods[i] = 3; - break; - } - } - if (object.itemConditions) { - if (!Array.isArray(object.itemConditions)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.itemConditions: array expected"); - message.itemConditions = []; - for (var i = 0; i < object.itemConditions.length; ++i) - switch (object.itemConditions[i]) { - default: - if (typeof object.itemConditions[i] === "number") { - message.itemConditions[i] = object.itemConditions[i]; - break; - } - case "ITEM_CONDITION_UNSPECIFIED": - case 0: - message.itemConditions[i] = 0; - break; - case "NEW": - case 1: - message.itemConditions[i] = 1; - break; - case "USED": - case 2: - message.itemConditions[i] = 2; - break; - } - } - if (object.returnShippingFee != null) { - if (typeof object.returnShippingFee !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.returnShippingFee: object expected"); - message.returnShippingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.fromObject(object.returnShippingFee); - } - if (object.returnPolicyUri != null) - message.returnPolicyUri = String(object.returnPolicyUri); - if (object.acceptDefectiveOnly != null) - message.acceptDefectiveOnly = Boolean(object.acceptDefectiveOnly); - if (object.processRefundDays != null) - message.processRefundDays = object.processRefundDays | 0; - if (object.acceptExchange != null) - message.acceptExchange = Boolean(object.acceptExchange); - return message; - }; - - /** - * Creates a plain object from an OnlineReturnPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy} message OnlineReturnPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OnlineReturnPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.countries = []; - object.returnMethods = []; - object.itemConditions = []; - } - if (options.defaults) { - object.name = ""; - object.returnPolicyId = ""; - object.label = ""; - object.policy = null; - object.restockingFee = null; - object.returnShippingFee = null; - object.returnPolicyUri = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.returnPolicyId != null && message.hasOwnProperty("returnPolicyId")) - object.returnPolicyId = message.returnPolicyId; - if (message.label != null && message.hasOwnProperty("label")) - object.label = message.label; - if (message.countries && message.countries.length) { - object.countries = []; - for (var j = 0; j < message.countries.length; ++j) - object.countries[j] = message.countries[j]; - } - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.toObject(message.policy, options); - if (message.restockingFee != null && message.hasOwnProperty("restockingFee")) - object.restockingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.toObject(message.restockingFee, options); - if (message.returnMethods && message.returnMethods.length) { - object.returnMethods = []; - for (var j = 0; j < message.returnMethods.length; ++j) - object.returnMethods[j] = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod[message.returnMethods[j]] === undefined ? message.returnMethods[j] : $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod[message.returnMethods[j]] : message.returnMethods[j]; - } - if (message.itemConditions && message.itemConditions.length) { - object.itemConditions = []; - for (var j = 0; j < message.itemConditions.length; ++j) - object.itemConditions[j] = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition[message.itemConditions[j]] === undefined ? message.itemConditions[j] : $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition[message.itemConditions[j]] : message.itemConditions[j]; - } - if (message.returnShippingFee != null && message.hasOwnProperty("returnShippingFee")) - object.returnShippingFee = $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.toObject(message.returnShippingFee, options); - if (message.returnPolicyUri != null && message.hasOwnProperty("returnPolicyUri")) - object.returnPolicyUri = message.returnPolicyUri; - if (message.acceptDefectiveOnly != null && message.hasOwnProperty("acceptDefectiveOnly")) { - object.acceptDefectiveOnly = message.acceptDefectiveOnly; - if (options.oneofs) - object._acceptDefectiveOnly = "acceptDefectiveOnly"; - } - if (message.processRefundDays != null && message.hasOwnProperty("processRefundDays")) { - object.processRefundDays = message.processRefundDays; - if (options.oneofs) - object._processRefundDays = "processRefundDays"; - } - if (message.acceptExchange != null && message.hasOwnProperty("acceptExchange")) { - object.acceptExchange = message.acceptExchange; - if (options.oneofs) - object._acceptExchange = "acceptExchange"; - } - return object; - }; - - /** - * Converts this OnlineReturnPolicy to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @instance - * @returns {Object.} JSON object - */ - OnlineReturnPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OnlineReturnPolicy - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OnlineReturnPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy"; - }; - - OnlineReturnPolicy.ReturnShippingFee = (function() { - - /** - * Properties of a ReturnShippingFee. - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @interface IReturnShippingFee - * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type|null} [type] ReturnShippingFee type - * @property {google.shopping.type.IPrice|null} [fixedFee] ReturnShippingFee fixedFee - */ - - /** - * Constructs a new ReturnShippingFee. - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @classdesc Represents a ReturnShippingFee. - * @implements IReturnShippingFee - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee=} [properties] Properties to set - */ - function ReturnShippingFee(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]]; - } - - /** - * ReturnShippingFee type. - * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type} type - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @instance - */ - ReturnShippingFee.prototype.type = 0; - - /** - * ReturnShippingFee fixedFee. - * @member {google.shopping.type.IPrice|null|undefined} fixedFee - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @instance - */ - ReturnShippingFee.prototype.fixedFee = null; - - /** - * Creates a new ReturnShippingFee instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee} ReturnShippingFee instance - */ - ReturnShippingFee.create = function create(properties) { - return new ReturnShippingFee(properties); - }; - - /** - * Encodes the specified ReturnShippingFee message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee} message ReturnShippingFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReturnShippingFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.fixedFee != null && Object.hasOwnProperty.call(message, "fixedFee")) - $root.google.shopping.type.Price.encode(message.fixedFee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReturnShippingFee message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IReturnShippingFee} message ReturnShippingFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReturnShippingFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReturnShippingFee message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @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.OnlineReturnPolicy.ReturnShippingFee} ReturnShippingFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReturnShippingFee.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.OnlineReturnPolicy.ReturnShippingFee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.fixedFee = $root.google.shopping.type.Price.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReturnShippingFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee} ReturnShippingFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReturnShippingFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReturnShippingFee message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReturnShippingFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.fixedFee != null && message.hasOwnProperty("fixedFee")) { - var error = $root.google.shopping.type.Price.verify(message.fixedFee); - if (error) - return "fixedFee." + error; - } - return null; - }; - - /** - * Creates a ReturnShippingFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee} ReturnShippingFee - */ - ReturnShippingFee.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "FIXED": - case 1: - message.type = 1; - break; - case "CUSTOMER_PAYING_ACTUAL_FEE": - case 2: - message.type = 2; - break; - } - if (object.fixedFee != null) { - if (typeof object.fixedFee !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.fixedFee: object expected"); - message.fixedFee = $root.google.shopping.type.Price.fromObject(object.fixedFee); - } - return message; - }; - - /** - * Creates a plain object from a ReturnShippingFee message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee} message ReturnShippingFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReturnShippingFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.fixedFee = null; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type[message.type] === undefined ? message.type : $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type[message.type] : message.type; - if (message.fixedFee != null && message.hasOwnProperty("fixedFee")) - object.fixedFee = $root.google.shopping.type.Price.toObject(message.fixedFee, options); - return object; - }; - - /** - * Converts this ReturnShippingFee to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @instance - * @returns {Object.} JSON object - */ - ReturnShippingFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReturnShippingFee - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReturnShippingFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee"; - }; - - /** - * Type enum. - * @name google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnShippingFee.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} FIXED=1 FIXED value - * @property {number} CUSTOMER_PAYING_ACTUAL_FEE=2 CUSTOMER_PAYING_ACTUAL_FEE value - */ - ReturnShippingFee.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FIXED"] = 1; - values[valuesById[2] = "CUSTOMER_PAYING_ACTUAL_FEE"] = 2; - return values; - })(); - - return ReturnShippingFee; - })(); - - OnlineReturnPolicy.RestockingFee = (function() { - - /** - * Properties of a RestockingFee. - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @interface IRestockingFee - * @property {google.shopping.type.IPrice|null} [fixedFee] RestockingFee fixedFee - * @property {number|null} [microPercent] RestockingFee microPercent - */ - - /** - * Constructs a new RestockingFee. - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @classdesc Represents a RestockingFee. - * @implements IRestockingFee - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee=} [properties] Properties to set - */ - function RestockingFee(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]]; - } - - /** - * RestockingFee fixedFee. - * @member {google.shopping.type.IPrice|null|undefined} fixedFee - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @instance - */ - RestockingFee.prototype.fixedFee = null; - - /** - * RestockingFee microPercent. - * @member {number|null|undefined} microPercent - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @instance - */ - RestockingFee.prototype.microPercent = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestockingFee type. - * @member {"fixedFee"|"microPercent"|undefined} type - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @instance - */ - Object.defineProperty(RestockingFee.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["fixedFee", "microPercent"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestockingFee instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee} RestockingFee instance - */ - RestockingFee.create = function create(properties) { - return new RestockingFee(properties); - }; - - /** - * Encodes the specified RestockingFee message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee} message RestockingFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestockingFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fixedFee != null && Object.hasOwnProperty.call(message, "fixedFee")) - $root.google.shopping.type.Price.encode(message.fixedFee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.microPercent != null && Object.hasOwnProperty.call(message, "microPercent")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.microPercent); - return writer; - }; - - /** - * Encodes the specified RestockingFee message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IRestockingFee} message RestockingFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestockingFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestockingFee message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @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.OnlineReturnPolicy.RestockingFee} RestockingFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestockingFee.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.OnlineReturnPolicy.RestockingFee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fixedFee = $root.google.shopping.type.Price.decode(reader, reader.uint32()); - break; - } - case 2: { - message.microPercent = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestockingFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee} RestockingFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestockingFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestockingFee message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestockingFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.fixedFee != null && message.hasOwnProperty("fixedFee")) { - properties.type = 1; - { - var error = $root.google.shopping.type.Price.verify(message.fixedFee); - if (error) - return "fixedFee." + error; - } - } - if (message.microPercent != null && message.hasOwnProperty("microPercent")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - if (!$util.isInteger(message.microPercent)) - return "microPercent: integer expected"; - } - return null; - }; - - /** - * Creates a RestockingFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee} RestockingFee - */ - RestockingFee.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee(); - if (object.fixedFee != null) { - if (typeof object.fixedFee !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee.fixedFee: object expected"); - message.fixedFee = $root.google.shopping.type.Price.fromObject(object.fixedFee); - } - if (object.microPercent != null) - message.microPercent = object.microPercent | 0; - return message; - }; - - /** - * Creates a plain object from a RestockingFee message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee} message RestockingFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestockingFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.fixedFee != null && message.hasOwnProperty("fixedFee")) { - object.fixedFee = $root.google.shopping.type.Price.toObject(message.fixedFee, options); - if (options.oneofs) - object.type = "fixedFee"; - } - if (message.microPercent != null && message.hasOwnProperty("microPercent")) { - object.microPercent = message.microPercent; - if (options.oneofs) - object.type = "microPercent"; - } - return object; - }; - - /** - * Converts this RestockingFee to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @instance - * @returns {Object.} JSON object - */ - RestockingFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestockingFee - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestockingFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.RestockingFee"; - }; - - return RestockingFee; - })(); - - OnlineReturnPolicy.Policy = (function() { - - /** - * Properties of a Policy. - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @interface IPolicy - * @property {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type|null} [type] Policy type - * @property {number|Long|null} [days] Policy days - */ - - /** - * Constructs a new Policy. - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy=} [properties] Properties to set - */ - function Policy(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]]; - } - - /** - * Policy type. - * @member {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type} type - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @instance - */ - Policy.prototype.type = 0; - - /** - * Policy days. - * @member {number|Long} days - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @instance - */ - Policy.prototype.days = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.days != null && Object.hasOwnProperty.call(message, "days")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.days); - return writer; - }; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @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.OnlineReturnPolicy.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.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.OnlineReturnPolicy.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.days = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Policy message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.days != null && message.hasOwnProperty("days")) - if (!$util.isInteger(message.days) && !(message.days && $util.isInteger(message.days.low) && $util.isInteger(message.days.high))) - return "days: integer|Long expected"; - return null; - }; - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "NUMBER_OF_DAYS_AFTER_DELIVERY": - case 1: - message.type = 1; - break; - case "NO_RETURNS": - case 2: - message.type = 2; - break; - case "LIFETIME_RETURNS": - case 3: - message.type = 3; - break; - } - if (object.days != null) - if ($util.Long) - (message.days = $util.Long.fromValue(object.days)).unsigned = false; - else if (typeof object.days === "string") - message.days = parseInt(object.days, 10); - else if (typeof object.days === "number") - message.days = object.days; - else if (typeof object.days === "object") - message.days = new $util.LongBits(object.days.low >>> 0, object.days.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @static - * @param {google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.days = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.days = options.longs === String ? "0" : 0; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type[message.type] === undefined ? message.type : $root.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type[message.type] : message.type; - if (message.days != null && message.hasOwnProperty("days")) - if (typeof message.days === "number") - object.days = options.longs === String ? String(message.days) : message.days; - else - object.days = options.longs === String ? $util.Long.prototype.toString.call(message.days) : options.longs === Number ? new $util.LongBits(message.days.low >>> 0, message.days.high >>> 0).toNumber() : message.days; - return object; - }; - - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Policy - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy"; - }; - - /** - * Type enum. - * @name google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.Policy.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} NUMBER_OF_DAYS_AFTER_DELIVERY=1 NUMBER_OF_DAYS_AFTER_DELIVERY value - * @property {number} NO_RETURNS=2 NO_RETURNS value - * @property {number} LIFETIME_RETURNS=3 LIFETIME_RETURNS value - */ - Policy.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NUMBER_OF_DAYS_AFTER_DELIVERY"] = 1; - values[valuesById[2] = "NO_RETURNS"] = 2; - values[valuesById[3] = "LIFETIME_RETURNS"] = 3; - return values; - })(); - - return Policy; - })(); - - /** - * ReturnMethod enum. - * @name google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ReturnMethod - * @enum {number} - * @property {number} RETURN_METHOD_UNSPECIFIED=0 RETURN_METHOD_UNSPECIFIED value - * @property {number} BY_MAIL=1 BY_MAIL value - * @property {number} IN_STORE=2 IN_STORE value - * @property {number} AT_A_KIOSK=3 AT_A_KIOSK value - */ - OnlineReturnPolicy.ReturnMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETURN_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "BY_MAIL"] = 1; - values[valuesById[2] = "IN_STORE"] = 2; - values[valuesById[3] = "AT_A_KIOSK"] = 3; - return values; - })(); - - /** - * ItemCondition enum. - * @name google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy.ItemCondition - * @enum {number} - * @property {number} ITEM_CONDITION_UNSPECIFIED=0 ITEM_CONDITION_UNSPECIFIED value - * @property {number} NEW=1 NEW value - * @property {number} USED=2 USED value - */ - OnlineReturnPolicy.ItemCondition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ITEM_CONDITION_UNSPECIFIED"] = 0; - values[valuesById[1] = "NEW"] = 1; - values[valuesById[2] = "USED"] = 2; - return values; - })(); - - return OnlineReturnPolicy; - })(); - - v1beta.ProgramsService = (function() { - - /** - * Constructs a new ProgramsService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ProgramsService - * @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 ProgramsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ProgramsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProgramsService; - - /** - * Creates new ProgramsService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @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 {ProgramsService} RPC service. Useful where requests and/or responses are streamed. - */ - ProgramsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|getProgram}. - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @typedef GetProgramCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Program} [response] Program - */ - - /** - * Calls GetProgram. - * @function getProgram - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest} request GetProgramRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.ProgramsService.GetProgramCallback} callback Node-style callback called with the error, if any, and Program - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProgramsService.prototype.getProgram = function getProgram(request, callback) { - return this.rpcCall(getProgram, $root.google.shopping.merchant.accounts.v1beta.GetProgramRequest, $root.google.shopping.merchant.accounts.v1beta.Program, request, callback); - }, "name", { value: "GetProgram" }); - - /** - * Calls GetProgram. - * @function getProgram - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest} request GetProgramRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|listPrograms}. - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @typedef ListProgramsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} [response] ListProgramsResponse - */ - - /** - * Calls ListPrograms. - * @function listPrograms - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest} request ListProgramsRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.ProgramsService.ListProgramsCallback} callback Node-style callback called with the error, if any, and ListProgramsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProgramsService.prototype.listPrograms = function listPrograms(request, callback) { - return this.rpcCall(listPrograms, $root.google.shopping.merchant.accounts.v1beta.ListProgramsRequest, $root.google.shopping.merchant.accounts.v1beta.ListProgramsResponse, request, callback); - }, "name", { value: "ListPrograms" }); - - /** - * Calls ListPrograms. - * @function listPrograms - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest} request ListProgramsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|enableProgram}. - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @typedef EnableProgramCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Program} [response] Program - */ - - /** - * Calls EnableProgram. - * @function enableProgram - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest} request EnableProgramRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.ProgramsService.EnableProgramCallback} callback Node-style callback called with the error, if any, and Program - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProgramsService.prototype.enableProgram = function enableProgram(request, callback) { - return this.rpcCall(enableProgram, $root.google.shopping.merchant.accounts.v1beta.EnableProgramRequest, $root.google.shopping.merchant.accounts.v1beta.Program, request, callback); - }, "name", { value: "EnableProgram" }); - - /** - * Calls EnableProgram. - * @function enableProgram - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest} request EnableProgramRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ProgramsService|disableProgram}. - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @typedef DisableProgramCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Program} [response] Program - */ - - /** - * Calls DisableProgram. - * @function disableProgram - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest} request DisableProgramRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.ProgramsService.DisableProgramCallback} callback Node-style callback called with the error, if any, and Program - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ProgramsService.prototype.disableProgram = function disableProgram(request, callback) { - return this.rpcCall(disableProgram, $root.google.shopping.merchant.accounts.v1beta.DisableProgramRequest, $root.google.shopping.merchant.accounts.v1beta.Program, request, callback); - }, "name", { value: "DisableProgram" }); - - /** - * Calls DisableProgram. - * @function disableProgram - * @memberof google.shopping.merchant.accounts.v1beta.ProgramsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest} request DisableProgramRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ProgramsService; - })(); - - v1beta.Program = (function() { - - /** - * Properties of a Program. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IProgram - * @property {string|null} [name] Program name - * @property {string|null} [documentationUri] Program documentationUri - * @property {google.shopping.merchant.accounts.v1beta.Program.State|null} [state] Program state - * @property {Array.|null} [activeRegionCodes] Program activeRegionCodes - * @property {Array.|null} [unmetRequirements] Program unmetRequirements - */ - - /** - * Constructs a new Program. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Program. - * @implements IProgram - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IProgram=} [properties] Properties to set - */ - function Program(properties) { - this.activeRegionCodes = []; - this.unmetRequirements = []; - 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]]; - } - - /** - * Program name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @instance - */ - Program.prototype.name = ""; - - /** - * Program documentationUri. - * @member {string} documentationUri - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @instance - */ - Program.prototype.documentationUri = ""; - - /** - * Program state. - * @member {google.shopping.merchant.accounts.v1beta.Program.State} state - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @instance - */ - Program.prototype.state = 0; - - /** - * Program activeRegionCodes. - * @member {Array.} activeRegionCodes - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @instance - */ - Program.prototype.activeRegionCodes = $util.emptyArray; - - /** - * Program unmetRequirements. - * @member {Array.} unmetRequirements - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @instance - */ - Program.prototype.unmetRequirements = $util.emptyArray; - - /** - * Creates a new Program instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @static - * @param {google.shopping.merchant.accounts.v1beta.IProgram=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Program} Program instance - */ - Program.create = function create(properties) { - return new Program(properties); - }; - - /** - * Encodes the specified Program message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @static - * @param {google.shopping.merchant.accounts.v1beta.IProgram} message Program message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Program.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.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentationUri); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.activeRegionCodes != null && message.activeRegionCodes.length) - for (var i = 0; i < message.activeRegionCodes.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.activeRegionCodes[i]); - if (message.unmetRequirements != null && message.unmetRequirements.length) - for (var i = 0; i < message.unmetRequirements.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Program.Requirement.encode(message.unmetRequirements[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Program message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @static - * @param {google.shopping.merchant.accounts.v1beta.IProgram} message Program message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Program.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Program message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @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.Program} Program - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Program.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.Program(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.documentationUri = reader.string(); - break; - } - case 3: { - message.state = reader.int32(); - break; - } - case 4: { - if (!(message.activeRegionCodes && message.activeRegionCodes.length)) - message.activeRegionCodes = []; - message.activeRegionCodes.push(reader.string()); - break; - } - case 5: { - if (!(message.unmetRequirements && message.unmetRequirements.length)) - message.unmetRequirements = []; - message.unmetRequirements.push($root.google.shopping.merchant.accounts.v1beta.Program.Requirement.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Program message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Program} Program - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Program.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Program message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Program.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.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.activeRegionCodes != null && message.hasOwnProperty("activeRegionCodes")) { - if (!Array.isArray(message.activeRegionCodes)) - return "activeRegionCodes: array expected"; - for (var i = 0; i < message.activeRegionCodes.length; ++i) - if (!$util.isString(message.activeRegionCodes[i])) - return "activeRegionCodes: string[] expected"; - } - if (message.unmetRequirements != null && message.hasOwnProperty("unmetRequirements")) { - if (!Array.isArray(message.unmetRequirements)) - return "unmetRequirements: array expected"; - for (var i = 0; i < message.unmetRequirements.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Program.Requirement.verify(message.unmetRequirements[i]); - if (error) - return "unmetRequirements." + error; - } - } - return null; - }; - - /** - * Creates a Program message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Program} Program - */ - Program.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Program) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Program(); - if (object.name != null) - message.name = String(object.name); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NOT_ELIGIBLE": - case 1: - message.state = 1; - break; - case "ELIGIBLE": - case 2: - message.state = 2; - break; - case "ENABLED": - case 3: - message.state = 3; - break; - } - if (object.activeRegionCodes) { - if (!Array.isArray(object.activeRegionCodes)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Program.activeRegionCodes: array expected"); - message.activeRegionCodes = []; - for (var i = 0; i < object.activeRegionCodes.length; ++i) - message.activeRegionCodes[i] = String(object.activeRegionCodes[i]); - } - if (object.unmetRequirements) { - if (!Array.isArray(object.unmetRequirements)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Program.unmetRequirements: array expected"); - message.unmetRequirements = []; - for (var i = 0; i < object.unmetRequirements.length; ++i) { - if (typeof object.unmetRequirements[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Program.unmetRequirements: object expected"); - message.unmetRequirements[i] = $root.google.shopping.merchant.accounts.v1beta.Program.Requirement.fromObject(object.unmetRequirements[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Program message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @static - * @param {google.shopping.merchant.accounts.v1beta.Program} message Program - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Program.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.activeRegionCodes = []; - object.unmetRequirements = []; - } - if (options.defaults) { - object.name = ""; - object.documentationUri = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.Program.State[message.state] === undefined ? message.state : $root.google.shopping.merchant.accounts.v1beta.Program.State[message.state] : message.state; - if (message.activeRegionCodes && message.activeRegionCodes.length) { - object.activeRegionCodes = []; - for (var j = 0; j < message.activeRegionCodes.length; ++j) - object.activeRegionCodes[j] = message.activeRegionCodes[j]; - } - if (message.unmetRequirements && message.unmetRequirements.length) { - object.unmetRequirements = []; - for (var j = 0; j < message.unmetRequirements.length; ++j) - object.unmetRequirements[j] = $root.google.shopping.merchant.accounts.v1beta.Program.Requirement.toObject(message.unmetRequirements[j], options); - } - return object; - }; - - /** - * Converts this Program to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @instance - * @returns {Object.} JSON object - */ - Program.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Program - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Program.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Program"; - }; - - Program.Requirement = (function() { - - /** - * Properties of a Requirement. - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @interface IRequirement - * @property {string|null} [title] Requirement title - * @property {string|null} [documentationUri] Requirement documentationUri - * @property {Array.|null} [affectedRegionCodes] Requirement affectedRegionCodes - */ - - /** - * Constructs a new Requirement. - * @memberof google.shopping.merchant.accounts.v1beta.Program - * @classdesc Represents a Requirement. - * @implements IRequirement - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.Program.IRequirement=} [properties] Properties to set - */ - function Requirement(properties) { - this.affectedRegionCodes = []; - 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]]; - } - - /** - * Requirement title. - * @member {string} title - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @instance - */ - Requirement.prototype.title = ""; - - /** - * Requirement documentationUri. - * @member {string} documentationUri - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @instance - */ - Requirement.prototype.documentationUri = ""; - - /** - * Requirement affectedRegionCodes. - * @member {Array.} affectedRegionCodes - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @instance - */ - Requirement.prototype.affectedRegionCodes = $util.emptyArray; - - /** - * Creates a new Requirement instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @static - * @param {google.shopping.merchant.accounts.v1beta.Program.IRequirement=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Program.Requirement} Requirement instance - */ - Requirement.create = function create(properties) { - return new Requirement(properties); - }; - - /** - * Encodes the specified Requirement message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.Requirement.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @static - * @param {google.shopping.merchant.accounts.v1beta.Program.IRequirement} message Requirement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Requirement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentationUri); - if (message.affectedRegionCodes != null && message.affectedRegionCodes.length) - for (var i = 0; i < message.affectedRegionCodes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.affectedRegionCodes[i]); - return writer; - }; - - /** - * Encodes the specified Requirement message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Program.Requirement.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @static - * @param {google.shopping.merchant.accounts.v1beta.Program.IRequirement} message Requirement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Requirement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Requirement message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @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.Program.Requirement} Requirement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Requirement.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.Program.Requirement(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.title = reader.string(); - break; - } - case 2: { - message.documentationUri = reader.string(); - break; - } - case 3: { - if (!(message.affectedRegionCodes && message.affectedRegionCodes.length)) - message.affectedRegionCodes = []; - message.affectedRegionCodes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Requirement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Program.Requirement} Requirement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Requirement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Requirement message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Requirement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.affectedRegionCodes != null && message.hasOwnProperty("affectedRegionCodes")) { - if (!Array.isArray(message.affectedRegionCodes)) - return "affectedRegionCodes: array expected"; - for (var i = 0; i < message.affectedRegionCodes.length; ++i) - if (!$util.isString(message.affectedRegionCodes[i])) - return "affectedRegionCodes: string[] expected"; - } - return null; - }; - - /** - * Creates a Requirement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Program.Requirement} Requirement - */ - Requirement.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Program.Requirement) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Program.Requirement(); - if (object.title != null) - message.title = String(object.title); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.affectedRegionCodes) { - if (!Array.isArray(object.affectedRegionCodes)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Program.Requirement.affectedRegionCodes: array expected"); - message.affectedRegionCodes = []; - for (var i = 0; i < object.affectedRegionCodes.length; ++i) - message.affectedRegionCodes[i] = String(object.affectedRegionCodes[i]); - } - return message; - }; - - /** - * Creates a plain object from a Requirement message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @static - * @param {google.shopping.merchant.accounts.v1beta.Program.Requirement} message Requirement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Requirement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.affectedRegionCodes = []; - if (options.defaults) { - object.title = ""; - object.documentationUri = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.affectedRegionCodes && message.affectedRegionCodes.length) { - object.affectedRegionCodes = []; - for (var j = 0; j < message.affectedRegionCodes.length; ++j) - object.affectedRegionCodes[j] = message.affectedRegionCodes[j]; - } - return object; - }; - - /** - * Converts this Requirement to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @instance - * @returns {Object.} JSON object - */ - Requirement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Requirement - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Program.Requirement - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Requirement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Program.Requirement"; - }; - - return Requirement; - })(); - - /** - * State enum. - * @name google.shopping.merchant.accounts.v1beta.Program.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} NOT_ELIGIBLE=1 NOT_ELIGIBLE value - * @property {number} ELIGIBLE=2 ELIGIBLE value - * @property {number} ENABLED=3 ENABLED value - */ - Program.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NOT_ELIGIBLE"] = 1; - values[valuesById[2] = "ELIGIBLE"] = 2; - values[valuesById[3] = "ENABLED"] = 3; - return values; - })(); - - return Program; - })(); - - v1beta.GetProgramRequest = (function() { - - /** - * Properties of a GetProgramRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetProgramRequest - * @property {string|null} [name] GetProgramRequest name - */ - - /** - * Constructs a new GetProgramRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetProgramRequest. - * @implements IGetProgramRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest=} [properties] Properties to set - */ - function GetProgramRequest(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]]; - } - - /** - * GetProgramRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @instance - */ - GetProgramRequest.prototype.name = ""; - - /** - * Creates a new GetProgramRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetProgramRequest} GetProgramRequest instance - */ - GetProgramRequest.create = function create(properties) { - return new GetProgramRequest(properties); - }; - - /** - * Encodes the specified GetProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetProgramRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest} message GetProgramRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProgramRequest.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 GetProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetProgramRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetProgramRequest} message GetProgramRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProgramRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProgramRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @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.GetProgramRequest} GetProgramRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProgramRequest.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.GetProgramRequest(); - 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 GetProgramRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetProgramRequest} GetProgramRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProgramRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProgramRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProgramRequest.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 GetProgramRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetProgramRequest} GetProgramRequest - */ - GetProgramRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetProgramRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetProgramRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetProgramRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetProgramRequest} message GetProgramRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProgramRequest.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 GetProgramRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @instance - * @returns {Object.} JSON object - */ - GetProgramRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetProgramRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetProgramRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetProgramRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetProgramRequest"; - }; - - return GetProgramRequest; - })(); - - v1beta.ListProgramsRequest = (function() { - - /** - * Properties of a ListProgramsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListProgramsRequest - * @property {string|null} [parent] ListProgramsRequest parent - * @property {number|null} [pageSize] ListProgramsRequest pageSize - * @property {string|null} [pageToken] ListProgramsRequest pageToken - */ - - /** - * Constructs a new ListProgramsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListProgramsRequest. - * @implements IListProgramsRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest=} [properties] Properties to set - */ - function ListProgramsRequest(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]]; - } - - /** - * ListProgramsRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @instance - */ - ListProgramsRequest.prototype.parent = ""; - - /** - * ListProgramsRequest pageSize. - * @member {number} pageSize - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @instance - */ - ListProgramsRequest.prototype.pageSize = 0; - - /** - * ListProgramsRequest pageToken. - * @member {string} pageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @instance - */ - ListProgramsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListProgramsRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsRequest} ListProgramsRequest instance - */ - ListProgramsRequest.create = function create(properties) { - return new ListProgramsRequest(properties); - }; - - /** - * Encodes the specified ListProgramsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest} message ListProgramsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProgramsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListProgramsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsRequest} message ListProgramsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProgramsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProgramsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @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.ListProgramsRequest} ListProgramsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProgramsRequest.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.ListProgramsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListProgramsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsRequest} ListProgramsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProgramsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProgramsRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProgramsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListProgramsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsRequest} ListProgramsRequest - */ - ListProgramsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListProgramsRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListProgramsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListProgramsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListProgramsRequest} message ListProgramsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProgramsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListProgramsRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @instance - * @returns {Object.} JSON object - */ - ListProgramsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProgramsRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProgramsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListProgramsRequest"; - }; - - return ListProgramsRequest; - })(); - - v1beta.ListProgramsResponse = (function() { - - /** - * Properties of a ListProgramsResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListProgramsResponse - * @property {Array.|null} [programs] ListProgramsResponse programs - * @property {string|null} [nextPageToken] ListProgramsResponse nextPageToken - */ - - /** - * Constructs a new ListProgramsResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListProgramsResponse. - * @implements IListProgramsResponse - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsResponse=} [properties] Properties to set - */ - function ListProgramsResponse(properties) { - this.programs = []; - 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]]; - } - - /** - * ListProgramsResponse programs. - * @member {Array.} programs - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @instance - */ - ListProgramsResponse.prototype.programs = $util.emptyArray; - - /** - * ListProgramsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @instance - */ - ListProgramsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListProgramsResponse instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsResponse=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} ListProgramsResponse instance - */ - ListProgramsResponse.create = function create(properties) { - return new ListProgramsResponse(properties); - }; - - /** - * Encodes the specified ListProgramsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsResponse.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsResponse} message ListProgramsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProgramsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.programs != null && message.programs.length) - for (var i = 0; i < message.programs.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Program.encode(message.programs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListProgramsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListProgramsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListProgramsResponse} message ListProgramsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProgramsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProgramsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @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.ListProgramsResponse} ListProgramsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProgramsResponse.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.ListProgramsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.programs && message.programs.length)) - message.programs = []; - message.programs.push($root.google.shopping.merchant.accounts.v1beta.Program.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListProgramsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} ListProgramsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProgramsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProgramsResponse message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProgramsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.programs != null && message.hasOwnProperty("programs")) { - if (!Array.isArray(message.programs)) - return "programs: array expected"; - for (var i = 0; i < message.programs.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Program.verify(message.programs[i]); - if (error) - return "programs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListProgramsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} ListProgramsResponse - */ - ListProgramsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListProgramsResponse) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListProgramsResponse(); - if (object.programs) { - if (!Array.isArray(object.programs)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListProgramsResponse.programs: array expected"); - message.programs = []; - for (var i = 0; i < object.programs.length; ++i) { - if (typeof object.programs[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListProgramsResponse.programs: object expected"); - message.programs[i] = $root.google.shopping.merchant.accounts.v1beta.Program.fromObject(object.programs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListProgramsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListProgramsResponse} message ListProgramsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProgramsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.programs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.programs && message.programs.length) { - object.programs = []; - for (var j = 0; j < message.programs.length; ++j) - object.programs[j] = $root.google.shopping.merchant.accounts.v1beta.Program.toObject(message.programs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListProgramsResponse to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @instance - * @returns {Object.} JSON object - */ - ListProgramsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProgramsResponse - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListProgramsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProgramsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListProgramsResponse"; - }; - - return ListProgramsResponse; - })(); - - v1beta.EnableProgramRequest = (function() { - - /** - * Properties of an EnableProgramRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IEnableProgramRequest - * @property {string|null} [name] EnableProgramRequest name - */ - - /** - * Constructs a new EnableProgramRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an EnableProgramRequest. - * @implements IEnableProgramRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest=} [properties] Properties to set - */ - function EnableProgramRequest(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]]; - } - - /** - * EnableProgramRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @instance - */ - EnableProgramRequest.prototype.name = ""; - - /** - * Creates a new EnableProgramRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.EnableProgramRequest} EnableProgramRequest instance - */ - EnableProgramRequest.create = function create(properties) { - return new EnableProgramRequest(properties); - }; - - /** - * Encodes the specified EnableProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EnableProgramRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest} message EnableProgramRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProgramRequest.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 EnableProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.EnableProgramRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IEnableProgramRequest} message EnableProgramRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProgramRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnableProgramRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @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.EnableProgramRequest} EnableProgramRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProgramRequest.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.EnableProgramRequest(); - 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 an EnableProgramRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.EnableProgramRequest} EnableProgramRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProgramRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnableProgramRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnableProgramRequest.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 an EnableProgramRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.EnableProgramRequest} EnableProgramRequest - */ - EnableProgramRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.EnableProgramRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.EnableProgramRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an EnableProgramRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.EnableProgramRequest} message EnableProgramRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnableProgramRequest.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 EnableProgramRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @instance - * @returns {Object.} JSON object - */ - EnableProgramRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnableProgramRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.EnableProgramRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnableProgramRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.EnableProgramRequest"; - }; - - return EnableProgramRequest; - })(); - - v1beta.DisableProgramRequest = (function() { - - /** - * Properties of a DisableProgramRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IDisableProgramRequest - * @property {string|null} [name] DisableProgramRequest name - */ - - /** - * Constructs a new DisableProgramRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a DisableProgramRequest. - * @implements IDisableProgramRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest=} [properties] Properties to set - */ - function DisableProgramRequest(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]]; - } - - /** - * DisableProgramRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @instance - */ - DisableProgramRequest.prototype.name = ""; - - /** - * Creates a new DisableProgramRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.DisableProgramRequest} DisableProgramRequest instance - */ - DisableProgramRequest.create = function create(properties) { - return new DisableProgramRequest(properties); - }; - - /** - * Encodes the specified DisableProgramRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DisableProgramRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest} message DisableProgramRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProgramRequest.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 DisableProgramRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DisableProgramRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDisableProgramRequest} message DisableProgramRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProgramRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisableProgramRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @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.DisableProgramRequest} DisableProgramRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProgramRequest.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.DisableProgramRequest(); - 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 DisableProgramRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.DisableProgramRequest} DisableProgramRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProgramRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisableProgramRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisableProgramRequest.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 DisableProgramRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.DisableProgramRequest} DisableProgramRequest - */ - DisableProgramRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DisableProgramRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.DisableProgramRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DisableProgramRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.DisableProgramRequest} message DisableProgramRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisableProgramRequest.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 DisableProgramRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @instance - * @returns {Object.} JSON object - */ - DisableProgramRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisableProgramRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.DisableProgramRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisableProgramRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DisableProgramRequest"; - }; - - return DisableProgramRequest; - })(); - - v1beta.RegionsService = (function() { - - /** - * Constructs a new RegionsService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a RegionsService - * @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 RegionsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (RegionsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionsService; - - /** - * Creates new RegionsService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @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 {RegionsService} RPC service. Useful where requests and/or responses are streamed. - */ - RegionsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|getRegion}. - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @typedef GetRegionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Region} [response] Region - */ - - /** - * Calls GetRegion. - * @function getRegion - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest} request GetRegionRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.RegionsService.GetRegionCallback} callback Node-style callback called with the error, if any, and Region - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RegionsService.prototype.getRegion = function getRegion(request, callback) { - return this.rpcCall(getRegion, $root.google.shopping.merchant.accounts.v1beta.GetRegionRequest, $root.google.shopping.merchant.accounts.v1beta.Region, request, callback); - }, "name", { value: "GetRegion" }); - - /** - * Calls GetRegion. - * @function getRegion - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest} request GetRegionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|createRegion}. - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @typedef CreateRegionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Region} [response] Region - */ - - /** - * Calls CreateRegion. - * @function createRegion - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest} request CreateRegionRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.RegionsService.CreateRegionCallback} callback Node-style callback called with the error, if any, and Region - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RegionsService.prototype.createRegion = function createRegion(request, callback) { - return this.rpcCall(createRegion, $root.google.shopping.merchant.accounts.v1beta.CreateRegionRequest, $root.google.shopping.merchant.accounts.v1beta.Region, request, callback); - }, "name", { value: "CreateRegion" }); - - /** - * Calls CreateRegion. - * @function createRegion - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest} request CreateRegionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|updateRegion}. - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @typedef UpdateRegionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.Region} [response] Region - */ - - /** - * Calls UpdateRegion. - * @function updateRegion - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest} request UpdateRegionRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.RegionsService.UpdateRegionCallback} callback Node-style callback called with the error, if any, and Region - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RegionsService.prototype.updateRegion = function updateRegion(request, callback) { - return this.rpcCall(updateRegion, $root.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest, $root.google.shopping.merchant.accounts.v1beta.Region, request, callback); - }, "name", { value: "UpdateRegion" }); - - /** - * Calls UpdateRegion. - * @function updateRegion - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest} request UpdateRegionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|deleteRegion}. - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @typedef DeleteRegionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteRegion. - * @function deleteRegion - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest} request DeleteRegionRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.RegionsService.DeleteRegionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RegionsService.prototype.deleteRegion = function deleteRegion(request, callback) { - return this.rpcCall(deleteRegion, $root.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteRegion" }); - - /** - * Calls DeleteRegion. - * @function deleteRegion - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest} request DeleteRegionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.RegionsService|listRegions}. - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @typedef ListRegionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} [response] ListRegionsResponse - */ - - /** - * Calls ListRegions. - * @function listRegions - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest} request ListRegionsRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.RegionsService.ListRegionsCallback} callback Node-style callback called with the error, if any, and ListRegionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(RegionsService.prototype.listRegions = function listRegions(request, callback) { - return this.rpcCall(listRegions, $root.google.shopping.merchant.accounts.v1beta.ListRegionsRequest, $root.google.shopping.merchant.accounts.v1beta.ListRegionsResponse, request, callback); - }, "name", { value: "ListRegions" }); - - /** - * Calls ListRegions. - * @function listRegions - * @memberof google.shopping.merchant.accounts.v1beta.RegionsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest} request ListRegionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return RegionsService; - })(); - - v1beta.GetRegionRequest = (function() { - - /** - * Properties of a GetRegionRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetRegionRequest - * @property {string|null} [name] GetRegionRequest name - */ - - /** - * Constructs a new GetRegionRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetRegionRequest. - * @implements IGetRegionRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest=} [properties] Properties to set - */ - function GetRegionRequest(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]]; - } - - /** - * GetRegionRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @instance - */ - GetRegionRequest.prototype.name = ""; - - /** - * Creates a new GetRegionRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetRegionRequest} GetRegionRequest instance - */ - GetRegionRequest.create = function create(properties) { - return new GetRegionRequest(properties); - }; - - /** - * Encodes the specified GetRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetRegionRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest} message GetRegionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRegionRequest.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 GetRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetRegionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetRegionRequest} message GetRegionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetRegionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetRegionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @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.GetRegionRequest} GetRegionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRegionRequest.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.GetRegionRequest(); - 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 GetRegionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetRegionRequest} GetRegionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetRegionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetRegionRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetRegionRequest.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 GetRegionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetRegionRequest} GetRegionRequest - */ - GetRegionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetRegionRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetRegionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetRegionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetRegionRequest} message GetRegionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetRegionRequest.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 GetRegionRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @instance - * @returns {Object.} JSON object - */ - GetRegionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetRegionRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetRegionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetRegionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetRegionRequest"; - }; - - return GetRegionRequest; - })(); - - v1beta.CreateRegionRequest = (function() { - - /** - * Properties of a CreateRegionRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ICreateRegionRequest - * @property {string|null} [parent] CreateRegionRequest parent - * @property {string|null} [regionId] CreateRegionRequest regionId - * @property {google.shopping.merchant.accounts.v1beta.IRegion|null} [region] CreateRegionRequest region - */ - - /** - * Constructs a new CreateRegionRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a CreateRegionRequest. - * @implements ICreateRegionRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest=} [properties] Properties to set - */ - function CreateRegionRequest(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]]; - } - - /** - * CreateRegionRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @instance - */ - CreateRegionRequest.prototype.parent = ""; - - /** - * CreateRegionRequest regionId. - * @member {string} regionId - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @instance - */ - CreateRegionRequest.prototype.regionId = ""; - - /** - * CreateRegionRequest region. - * @member {google.shopping.merchant.accounts.v1beta.IRegion|null|undefined} region - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @instance - */ - CreateRegionRequest.prototype.region = null; - - /** - * Creates a new CreateRegionRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.CreateRegionRequest} CreateRegionRequest instance - */ - CreateRegionRequest.create = function create(properties) { - return new CreateRegionRequest(properties); - }; - - /** - * Encodes the specified CreateRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateRegionRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest} message CreateRegionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateRegionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.regionId != null && Object.hasOwnProperty.call(message, "regionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionId); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - $root.google.shopping.merchant.accounts.v1beta.Region.encode(message.region, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CreateRegionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICreateRegionRequest} message CreateRegionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateRegionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateRegionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @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.CreateRegionRequest} CreateRegionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateRegionRequest.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.CreateRegionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.regionId = reader.string(); - break; - } - case 3: { - message.region = $root.google.shopping.merchant.accounts.v1beta.Region.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateRegionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.CreateRegionRequest} CreateRegionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateRegionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateRegionRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateRegionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.regionId != null && message.hasOwnProperty("regionId")) - if (!$util.isString(message.regionId)) - return "regionId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) { - var error = $root.google.shopping.merchant.accounts.v1beta.Region.verify(message.region); - if (error) - return "region." + error; - } - return null; - }; - - /** - * Creates a CreateRegionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.CreateRegionRequest} CreateRegionRequest - */ - CreateRegionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CreateRegionRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.CreateRegionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.regionId != null) - message.regionId = String(object.regionId); - if (object.region != null) { - if (typeof object.region !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.CreateRegionRequest.region: object expected"); - message.region = $root.google.shopping.merchant.accounts.v1beta.Region.fromObject(object.region); - } - return message; - }; - - /** - * Creates a plain object from a CreateRegionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.CreateRegionRequest} message CreateRegionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateRegionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.regionId = ""; - object.region = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.regionId != null && message.hasOwnProperty("regionId")) - object.regionId = message.regionId; - if (message.region != null && message.hasOwnProperty("region")) - object.region = $root.google.shopping.merchant.accounts.v1beta.Region.toObject(message.region, options); - return object; - }; - - /** - * Converts this CreateRegionRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateRegionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateRegionRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.CreateRegionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateRegionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CreateRegionRequest"; - }; - - return CreateRegionRequest; - })(); - - v1beta.UpdateRegionRequest = (function() { - - /** - * Properties of an UpdateRegionRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IUpdateRegionRequest - * @property {google.shopping.merchant.accounts.v1beta.IRegion|null} [region] UpdateRegionRequest region - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRegionRequest updateMask - */ - - /** - * Constructs a new UpdateRegionRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an UpdateRegionRequest. - * @implements IUpdateRegionRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest=} [properties] Properties to set - */ - function UpdateRegionRequest(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]]; - } - - /** - * UpdateRegionRequest region. - * @member {google.shopping.merchant.accounts.v1beta.IRegion|null|undefined} region - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @instance - */ - UpdateRegionRequest.prototype.region = null; - - /** - * UpdateRegionRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @instance - */ - UpdateRegionRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateRegionRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.UpdateRegionRequest} UpdateRegionRequest instance - */ - UpdateRegionRequest.create = function create(properties) { - return new UpdateRegionRequest(properties); - }; - - /** - * Encodes the specified UpdateRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest} message UpdateRegionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateRegionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - $root.google.shopping.merchant.accounts.v1beta.Region.encode(message.region, 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 UpdateRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest} message UpdateRegionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateRegionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateRegionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @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.UpdateRegionRequest} UpdateRegionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateRegionRequest.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.UpdateRegionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.region = $root.google.shopping.merchant.accounts.v1beta.Region.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 UpdateRegionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.UpdateRegionRequest} UpdateRegionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateRegionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateRegionRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateRegionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.region != null && message.hasOwnProperty("region")) { - var error = $root.google.shopping.merchant.accounts.v1beta.Region.verify(message.region); - if (error) - return "region." + 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 UpdateRegionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.UpdateRegionRequest} UpdateRegionRequest - */ - UpdateRegionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest(); - if (object.region != null) { - if (typeof object.region !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.region: object expected"); - message.region = $root.google.shopping.merchant.accounts.v1beta.Region.fromObject(object.region); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.UpdateRegionRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateRegionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.UpdateRegionRequest} message UpdateRegionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateRegionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.region = null; - object.updateMask = null; - } - if (message.region != null && message.hasOwnProperty("region")) - object.region = $root.google.shopping.merchant.accounts.v1beta.Region.toObject(message.region, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateRegionRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateRegionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateRegionRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.UpdateRegionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateRegionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.UpdateRegionRequest"; - }; - - return UpdateRegionRequest; - })(); - - v1beta.DeleteRegionRequest = (function() { - - /** - * Properties of a DeleteRegionRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IDeleteRegionRequest - * @property {string|null} [name] DeleteRegionRequest name - */ - - /** - * Constructs a new DeleteRegionRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a DeleteRegionRequest. - * @implements IDeleteRegionRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest=} [properties] Properties to set - */ - function DeleteRegionRequest(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]]; - } - - /** - * DeleteRegionRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @instance - */ - DeleteRegionRequest.prototype.name = ""; - - /** - * Creates a new DeleteRegionRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.DeleteRegionRequest} DeleteRegionRequest instance - */ - DeleteRegionRequest.create = function create(properties) { - return new DeleteRegionRequest(properties); - }; - - /** - * Encodes the specified DeleteRegionRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteRegionRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest} message DeleteRegionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRegionRequest.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 DeleteRegionRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeleteRegionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest} message DeleteRegionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteRegionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteRegionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @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.DeleteRegionRequest} DeleteRegionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRegionRequest.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.DeleteRegionRequest(); - 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 DeleteRegionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.DeleteRegionRequest} DeleteRegionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteRegionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteRegionRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteRegionRequest.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 DeleteRegionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.DeleteRegionRequest} DeleteRegionRequest - */ - DeleteRegionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteRegionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.DeleteRegionRequest} message DeleteRegionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteRegionRequest.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 DeleteRegionRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteRegionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteRegionRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.DeleteRegionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteRegionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DeleteRegionRequest"; - }; - - return DeleteRegionRequest; - })(); - - v1beta.ListRegionsRequest = (function() { - - /** - * Properties of a ListRegionsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListRegionsRequest - * @property {string|null} [parent] ListRegionsRequest parent - * @property {number|null} [pageSize] ListRegionsRequest pageSize - * @property {string|null} [pageToken] ListRegionsRequest pageToken - */ - - /** - * Constructs a new ListRegionsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListRegionsRequest. - * @implements IListRegionsRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest=} [properties] Properties to set - */ - function ListRegionsRequest(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]]; - } - - /** - * ListRegionsRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @instance - */ - ListRegionsRequest.prototype.parent = ""; - - /** - * ListRegionsRequest pageSize. - * @member {number} pageSize - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @instance - */ - ListRegionsRequest.prototype.pageSize = 0; - - /** - * ListRegionsRequest pageToken. - * @member {string} pageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @instance - */ - ListRegionsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListRegionsRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsRequest} ListRegionsRequest instance - */ - ListRegionsRequest.create = function create(properties) { - return new ListRegionsRequest(properties); - }; - - /** - * Encodes the specified ListRegionsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest} message ListRegionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRegionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListRegionsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsRequest} message ListRegionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRegionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRegionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @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.ListRegionsRequest} ListRegionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRegionsRequest.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.ListRegionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRegionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsRequest} ListRegionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRegionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRegionsRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRegionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListRegionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsRequest} ListRegionsRequest - */ - ListRegionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListRegionsRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListRegionsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListRegionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListRegionsRequest} message ListRegionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRegionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListRegionsRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListRegionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRegionsRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRegionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListRegionsRequest"; - }; - - return ListRegionsRequest; - })(); - - v1beta.ListRegionsResponse = (function() { - - /** - * Properties of a ListRegionsResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IListRegionsResponse - * @property {Array.|null} [regions] ListRegionsResponse regions - * @property {string|null} [nextPageToken] ListRegionsResponse nextPageToken - */ - - /** - * Constructs a new ListRegionsResponse. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ListRegionsResponse. - * @implements IListRegionsResponse - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsResponse=} [properties] Properties to set - */ - function ListRegionsResponse(properties) { - this.regions = []; - 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]]; - } - - /** - * ListRegionsResponse regions. - * @member {Array.} regions - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @instance - */ - ListRegionsResponse.prototype.regions = $util.emptyArray; - - /** - * ListRegionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @instance - */ - ListRegionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListRegionsResponse instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsResponse=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} ListRegionsResponse instance - */ - ListRegionsResponse.create = function create(properties) { - return new ListRegionsResponse(properties); - }; - - /** - * Encodes the specified ListRegionsResponse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsResponse.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsResponse} message ListRegionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRegionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regions != null && message.regions.length) - for (var i = 0; i < message.regions.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Region.encode(message.regions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListRegionsResponse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ListRegionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IListRegionsResponse} message ListRegionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListRegionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListRegionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @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.ListRegionsResponse} ListRegionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRegionsResponse.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.ListRegionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.regions && message.regions.length)) - message.regions = []; - message.regions.push($root.google.shopping.merchant.accounts.v1beta.Region.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListRegionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} ListRegionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListRegionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListRegionsResponse message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListRegionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.regions != null && message.hasOwnProperty("regions")) { - if (!Array.isArray(message.regions)) - return "regions: array expected"; - for (var i = 0; i < message.regions.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Region.verify(message.regions[i]); - if (error) - return "regions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListRegionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} ListRegionsResponse - */ - ListRegionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ListRegionsResponse) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ListRegionsResponse(); - if (object.regions) { - if (!Array.isArray(object.regions)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListRegionsResponse.regions: array expected"); - message.regions = []; - for (var i = 0; i < object.regions.length; ++i) { - if (typeof object.regions[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ListRegionsResponse.regions: object expected"); - message.regions[i] = $root.google.shopping.merchant.accounts.v1beta.Region.fromObject(object.regions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListRegionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @static - * @param {google.shopping.merchant.accounts.v1beta.ListRegionsResponse} message ListRegionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListRegionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.regions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.regions && message.regions.length) { - object.regions = []; - for (var j = 0; j < message.regions.length; ++j) - object.regions[j] = $root.google.shopping.merchant.accounts.v1beta.Region.toObject(message.regions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListRegionsResponse to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListRegionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListRegionsResponse - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ListRegionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListRegionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ListRegionsResponse"; - }; - - return ListRegionsResponse; - })(); - - v1beta.Region = (function() { - - /** - * Properties of a Region. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IRegion - * @property {string|null} [name] Region name - * @property {string|null} [displayName] Region displayName - * @property {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea|null} [postalCodeArea] Region postalCodeArea - * @property {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea|null} [geotargetArea] Region geotargetArea - * @property {google.protobuf.IBoolValue|null} [regionalInventoryEligible] Region regionalInventoryEligible - * @property {google.protobuf.IBoolValue|null} [shippingEligible] Region shippingEligible - */ - - /** - * Constructs a new Region. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Region. - * @implements IRegion - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IRegion=} [properties] Properties to set - */ - function Region(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]]; - } - - /** - * Region name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @instance - */ - Region.prototype.name = ""; - - /** - * Region displayName. - * @member {string|null|undefined} displayName - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @instance - */ - Region.prototype.displayName = null; - - /** - * Region postalCodeArea. - * @member {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea|null|undefined} postalCodeArea - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @instance - */ - Region.prototype.postalCodeArea = null; - - /** - * Region geotargetArea. - * @member {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea|null|undefined} geotargetArea - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @instance - */ - Region.prototype.geotargetArea = null; - - /** - * Region regionalInventoryEligible. - * @member {google.protobuf.IBoolValue|null|undefined} regionalInventoryEligible - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @instance - */ - Region.prototype.regionalInventoryEligible = null; - - /** - * Region shippingEligible. - * @member {google.protobuf.IBoolValue|null|undefined} shippingEligible - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @instance - */ - Region.prototype.shippingEligible = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Region _displayName. - * @member {"displayName"|undefined} _displayName - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @instance - */ - Object.defineProperty(Region.prototype, "_displayName", { - get: $util.oneOfGetter($oneOfFields = ["displayName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Region instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRegion=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Region} Region instance - */ - Region.create = function create(properties) { - return new Region(properties); - }; - - /** - * Encodes the specified Region message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRegion} message Region message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Region.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.postalCodeArea != null && Object.hasOwnProperty.call(message, "postalCodeArea")) - $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.encode(message.postalCodeArea, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.geotargetArea != null && Object.hasOwnProperty.call(message, "geotargetArea")) - $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.encode(message.geotargetArea, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.regionalInventoryEligible != null && Object.hasOwnProperty.call(message, "regionalInventoryEligible")) - $root.google.protobuf.BoolValue.encode(message.regionalInventoryEligible, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.shippingEligible != null && Object.hasOwnProperty.call(message, "shippingEligible")) - $root.google.protobuf.BoolValue.encode(message.shippingEligible, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Region message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRegion} message Region message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Region.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Region message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @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.Region} Region - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Region.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.Region(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.postalCodeArea = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.decode(reader, reader.uint32()); - break; - } - case 4: { - message.geotargetArea = $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.decode(reader, reader.uint32()); - break; - } - case 5: { - message.regionalInventoryEligible = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - } - case 6: { - message.shippingEligible = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Region message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Region} Region - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Region.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Region message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Region.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) { - properties._displayName = 1; - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - } - if (message.postalCodeArea != null && message.hasOwnProperty("postalCodeArea")) { - var error = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify(message.postalCodeArea); - if (error) - return "postalCodeArea." + error; - } - if (message.geotargetArea != null && message.hasOwnProperty("geotargetArea")) { - var error = $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify(message.geotargetArea); - if (error) - return "geotargetArea." + error; - } - if (message.regionalInventoryEligible != null && message.hasOwnProperty("regionalInventoryEligible")) { - var error = $root.google.protobuf.BoolValue.verify(message.regionalInventoryEligible); - if (error) - return "regionalInventoryEligible." + error; - } - if (message.shippingEligible != null && message.hasOwnProperty("shippingEligible")) { - var error = $root.google.protobuf.BoolValue.verify(message.shippingEligible); - if (error) - return "shippingEligible." + error; - } - return null; - }; - - /** - * Creates a Region message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Region} Region - */ - Region.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Region) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Region(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.postalCodeArea != null) { - if (typeof object.postalCodeArea !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.postalCodeArea: object expected"); - message.postalCodeArea = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.fromObject(object.postalCodeArea); - } - if (object.geotargetArea != null) { - if (typeof object.geotargetArea !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.geotargetArea: object expected"); - message.geotargetArea = $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.fromObject(object.geotargetArea); - } - if (object.regionalInventoryEligible != null) { - if (typeof object.regionalInventoryEligible !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.regionalInventoryEligible: object expected"); - message.regionalInventoryEligible = $root.google.protobuf.BoolValue.fromObject(object.regionalInventoryEligible); - } - if (object.shippingEligible != null) { - if (typeof object.shippingEligible !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.shippingEligible: object expected"); - message.shippingEligible = $root.google.protobuf.BoolValue.fromObject(object.shippingEligible); - } - return message; - }; - - /** - * Creates a plain object from a Region message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region} message Region - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Region.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.postalCodeArea = null; - object.geotargetArea = null; - object.regionalInventoryEligible = null; - object.shippingEligible = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) { - object.displayName = message.displayName; - if (options.oneofs) - object._displayName = "displayName"; - } - if (message.postalCodeArea != null && message.hasOwnProperty("postalCodeArea")) - object.postalCodeArea = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.toObject(message.postalCodeArea, options); - if (message.geotargetArea != null && message.hasOwnProperty("geotargetArea")) - object.geotargetArea = $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.toObject(message.geotargetArea, options); - if (message.regionalInventoryEligible != null && message.hasOwnProperty("regionalInventoryEligible")) - object.regionalInventoryEligible = $root.google.protobuf.BoolValue.toObject(message.regionalInventoryEligible, options); - if (message.shippingEligible != null && message.hasOwnProperty("shippingEligible")) - object.shippingEligible = $root.google.protobuf.BoolValue.toObject(message.shippingEligible, options); - return object; - }; - - /** - * Converts this Region to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @instance - * @returns {Object.} JSON object - */ - Region.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Region - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Region.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Region"; - }; - - Region.PostalCodeArea = (function() { - - /** - * Properties of a PostalCodeArea. - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @interface IPostalCodeArea - * @property {string|null} [regionCode] PostalCodeArea regionCode - * @property {Array.|null} [postalCodes] PostalCodeArea postalCodes - */ - - /** - * Constructs a new PostalCodeArea. - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @classdesc Represents a PostalCodeArea. - * @implements IPostalCodeArea - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea=} [properties] Properties to set - */ - function PostalCodeArea(properties) { - this.postalCodes = []; - 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]]; - } - - /** - * PostalCodeArea regionCode. - * @member {string} regionCode - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @instance - */ - PostalCodeArea.prototype.regionCode = ""; - - /** - * PostalCodeArea postalCodes. - * @member {Array.} postalCodes - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @instance - */ - PostalCodeArea.prototype.postalCodes = $util.emptyArray; - - /** - * Creates a new PostalCodeArea instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea} PostalCodeArea instance - */ - PostalCodeArea.create = function create(properties) { - return new PostalCodeArea(properties); - }; - - /** - * Encodes the specified PostalCodeArea message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea} message PostalCodeArea message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PostalCodeArea.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); - if (message.postalCodes != null && message.postalCodes.length) - for (var i = 0; i < message.postalCodes.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.encode(message.postalCodes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PostalCodeArea message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.IPostalCodeArea} message PostalCodeArea message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PostalCodeArea.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PostalCodeArea message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @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.Region.PostalCodeArea} PostalCodeArea - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PostalCodeArea.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.Region.PostalCodeArea(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.regionCode = reader.string(); - break; - } - case 2: { - if (!(message.postalCodes && message.postalCodes.length)) - message.postalCodes = []; - message.postalCodes.push($root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PostalCodeArea message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea} PostalCodeArea - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PostalCodeArea.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PostalCodeArea message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PostalCodeArea.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.postalCodes != null && message.hasOwnProperty("postalCodes")) { - if (!Array.isArray(message.postalCodes)) - return "postalCodes: array expected"; - for (var i = 0; i < message.postalCodes.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify(message.postalCodes[i]); - if (error) - return "postalCodes." + error; - } - } - return null; - }; - - /** - * Creates a PostalCodeArea message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea} PostalCodeArea - */ - PostalCodeArea.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea(); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - if (object.postalCodes) { - if (!Array.isArray(object.postalCodes)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.postalCodes: array expected"); - message.postalCodes = []; - for (var i = 0; i < object.postalCodes.length; ++i) { - if (typeof object.postalCodes[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.postalCodes: object expected"); - message.postalCodes[i] = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.fromObject(object.postalCodes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PostalCodeArea message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea} message PostalCodeArea - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PostalCodeArea.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.postalCodes = []; - if (options.defaults) - object.regionCode = ""; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.postalCodes && message.postalCodes.length) { - object.postalCodes = []; - for (var j = 0; j < message.postalCodes.length; ++j) - object.postalCodes[j] = $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.toObject(message.postalCodes[j], options); - } - return object; - }; - - /** - * Converts this PostalCodeArea to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @instance - * @returns {Object.} JSON object - */ - PostalCodeArea.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PostalCodeArea - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PostalCodeArea.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea"; - }; - - PostalCodeArea.PostalCodeRange = (function() { - - /** - * Properties of a PostalCodeRange. - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @interface IPostalCodeRange - * @property {string|null} [begin] PostalCodeRange begin - * @property {string|null} [end] PostalCodeRange end - */ - - /** - * Constructs a new PostalCodeRange. - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea - * @classdesc Represents a PostalCodeRange. - * @implements IPostalCodeRange - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange=} [properties] Properties to set - */ - function PostalCodeRange(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]]; - } - - /** - * PostalCodeRange begin. - * @member {string} begin - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @instance - */ - PostalCodeRange.prototype.begin = ""; - - /** - * PostalCodeRange end. - * @member {string} end - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @instance - */ - PostalCodeRange.prototype.end = ""; - - /** - * Creates a new PostalCodeRange instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange} PostalCodeRange instance - */ - PostalCodeRange.create = function create(properties) { - return new PostalCodeRange(properties); - }; - - /** - * Encodes the specified PostalCodeRange message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange} message PostalCodeRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PostalCodeRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.end); - return writer; - }; - - /** - * Encodes the specified PostalCodeRange message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.IPostalCodeRange} message PostalCodeRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PostalCodeRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PostalCodeRange message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @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.Region.PostalCodeArea.PostalCodeRange} PostalCodeRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PostalCodeRange.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.Region.PostalCodeArea.PostalCodeRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.begin = reader.string(); - break; - } - case 2: { - message.end = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PostalCodeRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange} PostalCodeRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PostalCodeRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PostalCodeRange message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PostalCodeRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isString(message.begin)) - return "begin: string expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isString(message.end)) - return "end: string expected"; - return null; - }; - - /** - * Creates a PostalCodeRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange} PostalCodeRange - */ - PostalCodeRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange(); - if (object.begin != null) - message.begin = String(object.begin); - if (object.end != null) - message.end = String(object.end); - return message; - }; - - /** - * Creates a plain object from a PostalCodeRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange} message PostalCodeRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PostalCodeRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.begin = ""; - object.end = ""; - } - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this PostalCodeRange to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @instance - * @returns {Object.} JSON object - */ - PostalCodeRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PostalCodeRange - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PostalCodeRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Region.PostalCodeArea.PostalCodeRange"; - }; - - return PostalCodeRange; - })(); - - return PostalCodeArea; - })(); - - Region.GeoTargetArea = (function() { - - /** - * Properties of a GeoTargetArea. - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @interface IGeoTargetArea - * @property {Array.|null} [geotargetCriteriaIds] GeoTargetArea geotargetCriteriaIds - */ - - /** - * Constructs a new GeoTargetArea. - * @memberof google.shopping.merchant.accounts.v1beta.Region - * @classdesc Represents a GeoTargetArea. - * @implements IGeoTargetArea - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea=} [properties] Properties to set - */ - function GeoTargetArea(properties) { - this.geotargetCriteriaIds = []; - 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]]; - } - - /** - * GeoTargetArea geotargetCriteriaIds. - * @member {Array.} geotargetCriteriaIds - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @instance - */ - GeoTargetArea.prototype.geotargetCriteriaIds = $util.emptyArray; - - /** - * Creates a new GeoTargetArea instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea} GeoTargetArea instance - */ - GeoTargetArea.create = function create(properties) { - return new GeoTargetArea(properties); - }; - - /** - * Encodes the specified GeoTargetArea message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea} message GeoTargetArea message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeoTargetArea.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.geotargetCriteriaIds != null && message.geotargetCriteriaIds.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.geotargetCriteriaIds.length; ++i) - writer.int64(message.geotargetCriteriaIds[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified GeoTargetArea message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.IGeoTargetArea} message GeoTargetArea message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeoTargetArea.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeoTargetArea message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @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.Region.GeoTargetArea} GeoTargetArea - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeoTargetArea.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.Region.GeoTargetArea(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.geotargetCriteriaIds && message.geotargetCriteriaIds.length)) - message.geotargetCriteriaIds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.geotargetCriteriaIds.push(reader.int64()); - } else - message.geotargetCriteriaIds.push(reader.int64()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeoTargetArea message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea} GeoTargetArea - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeoTargetArea.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeoTargetArea message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeoTargetArea.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.geotargetCriteriaIds != null && message.hasOwnProperty("geotargetCriteriaIds")) { - if (!Array.isArray(message.geotargetCriteriaIds)) - return "geotargetCriteriaIds: array expected"; - for (var i = 0; i < message.geotargetCriteriaIds.length; ++i) - if (!$util.isInteger(message.geotargetCriteriaIds[i]) && !(message.geotargetCriteriaIds[i] && $util.isInteger(message.geotargetCriteriaIds[i].low) && $util.isInteger(message.geotargetCriteriaIds[i].high))) - return "geotargetCriteriaIds: integer|Long[] expected"; - } - return null; - }; - - /** - * Creates a GeoTargetArea message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea} GeoTargetArea - */ - GeoTargetArea.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea(); - if (object.geotargetCriteriaIds) { - if (!Array.isArray(object.geotargetCriteriaIds)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea.geotargetCriteriaIds: array expected"); - message.geotargetCriteriaIds = []; - for (var i = 0; i < object.geotargetCriteriaIds.length; ++i) - if ($util.Long) - (message.geotargetCriteriaIds[i] = $util.Long.fromValue(object.geotargetCriteriaIds[i])).unsigned = false; - else if (typeof object.geotargetCriteriaIds[i] === "string") - message.geotargetCriteriaIds[i] = parseInt(object.geotargetCriteriaIds[i], 10); - else if (typeof object.geotargetCriteriaIds[i] === "number") - message.geotargetCriteriaIds[i] = object.geotargetCriteriaIds[i]; - else if (typeof object.geotargetCriteriaIds[i] === "object") - message.geotargetCriteriaIds[i] = new $util.LongBits(object.geotargetCriteriaIds[i].low >>> 0, object.geotargetCriteriaIds[i].high >>> 0).toNumber(); - } - return message; - }; - - /** - * Creates a plain object from a GeoTargetArea message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @static - * @param {google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea} message GeoTargetArea - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeoTargetArea.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.geotargetCriteriaIds = []; - if (message.geotargetCriteriaIds && message.geotargetCriteriaIds.length) { - object.geotargetCriteriaIds = []; - for (var j = 0; j < message.geotargetCriteriaIds.length; ++j) - if (typeof message.geotargetCriteriaIds[j] === "number") - object.geotargetCriteriaIds[j] = options.longs === String ? String(message.geotargetCriteriaIds[j]) : message.geotargetCriteriaIds[j]; - else - object.geotargetCriteriaIds[j] = options.longs === String ? $util.Long.prototype.toString.call(message.geotargetCriteriaIds[j]) : options.longs === Number ? new $util.LongBits(message.geotargetCriteriaIds[j].low >>> 0, message.geotargetCriteriaIds[j].high >>> 0).toNumber() : message.geotargetCriteriaIds[j]; - } - return object; - }; - - /** - * Converts this GeoTargetArea to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @instance - * @returns {Object.} JSON object - */ - GeoTargetArea.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeoTargetArea - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeoTargetArea.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Region.GeoTargetArea"; - }; - - return GeoTargetArea; - })(); - - return Region; - })(); - - v1beta.ShippingSettingsService = (function() { - - /** - * Constructs a new ShippingSettingsService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ShippingSettingsService - * @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 ShippingSettingsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ShippingSettingsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ShippingSettingsService; - - /** - * Creates new ShippingSettingsService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService - * @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 {ShippingSettingsService} RPC service. Useful where requests and/or responses are streamed. - */ - ShippingSettingsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ShippingSettingsService|getShippingSettings}. - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService - * @typedef GetShippingSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ShippingSettings} [response] ShippingSettings - */ - - /** - * Calls GetShippingSettings. - * @function getShippingSettings - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest} request GetShippingSettingsRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.ShippingSettingsService.GetShippingSettingsCallback} callback Node-style callback called with the error, if any, and ShippingSettings - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ShippingSettingsService.prototype.getShippingSettings = function getShippingSettings(request, callback) { - return this.rpcCall(getShippingSettings, $root.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest, $root.google.shopping.merchant.accounts.v1beta.ShippingSettings, request, callback); - }, "name", { value: "GetShippingSettings" }); - - /** - * Calls GetShippingSettings. - * @function getShippingSettings - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest} request GetShippingSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.ShippingSettingsService|insertShippingSettings}. - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService - * @typedef InsertShippingSettingsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.ShippingSettings} [response] ShippingSettings - */ - - /** - * Calls InsertShippingSettings. - * @function insertShippingSettings - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest} request InsertShippingSettingsRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.ShippingSettingsService.InsertShippingSettingsCallback} callback Node-style callback called with the error, if any, and ShippingSettings - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ShippingSettingsService.prototype.insertShippingSettings = function insertShippingSettings(request, callback) { - return this.rpcCall(insertShippingSettings, $root.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest, $root.google.shopping.merchant.accounts.v1beta.ShippingSettings, request, callback); - }, "name", { value: "InsertShippingSettings" }); - - /** - * Calls InsertShippingSettings. - * @function insertShippingSettings - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettingsService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest} request InsertShippingSettingsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ShippingSettingsService; - })(); - - v1beta.ShippingSettings = (function() { - - /** - * Properties of a ShippingSettings. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IShippingSettings - * @property {string|null} [name] ShippingSettings name - * @property {Array.|null} [services] ShippingSettings services - * @property {Array.|null} [warehouses] ShippingSettings warehouses - * @property {string|null} [etag] ShippingSettings etag - */ - - /** - * Constructs a new ShippingSettings. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a ShippingSettings. - * @implements IShippingSettings - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IShippingSettings=} [properties] Properties to set - */ - function ShippingSettings(properties) { - this.services = []; - this.warehouses = []; - 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]]; - } - - /** - * ShippingSettings name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @instance - */ - ShippingSettings.prototype.name = ""; - - /** - * ShippingSettings services. - * @member {Array.} services - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @instance - */ - ShippingSettings.prototype.services = $util.emptyArray; - - /** - * ShippingSettings warehouses. - * @member {Array.} warehouses - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @instance - */ - ShippingSettings.prototype.warehouses = $util.emptyArray; - - /** - * ShippingSettings etag. - * @member {string} etag - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @instance - */ - ShippingSettings.prototype.etag = ""; - - /** - * Creates a new ShippingSettings instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @static - * @param {google.shopping.merchant.accounts.v1beta.IShippingSettings=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.ShippingSettings} ShippingSettings instance - */ - ShippingSettings.create = function create(properties) { - return new ShippingSettings(properties); - }; - - /** - * Encodes the specified ShippingSettings message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ShippingSettings.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @static - * @param {google.shopping.merchant.accounts.v1beta.IShippingSettings} message ShippingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShippingSettings.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.services != null && message.services.length) - for (var i = 0; i < message.services.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Service.encode(message.services[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.warehouses != null && message.warehouses.length) - for (var i = 0; i < message.warehouses.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Warehouse.encode(message.warehouses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); - return writer; - }; - - /** - * Encodes the specified ShippingSettings message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.ShippingSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @static - * @param {google.shopping.merchant.accounts.v1beta.IShippingSettings} message ShippingSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShippingSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShippingSettings message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @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.ShippingSettings} ShippingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShippingSettings.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.ShippingSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.services && message.services.length)) - message.services = []; - message.services.push($root.google.shopping.merchant.accounts.v1beta.Service.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.warehouses && message.warehouses.length)) - message.warehouses = []; - message.warehouses.push($root.google.shopping.merchant.accounts.v1beta.Warehouse.decode(reader, reader.uint32())); - break; - } - case 4: { - message.etag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShippingSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.ShippingSettings} ShippingSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShippingSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShippingSettings message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShippingSettings.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.services != null && message.hasOwnProperty("services")) { - if (!Array.isArray(message.services)) - return "services: array expected"; - for (var i = 0; i < message.services.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Service.verify(message.services[i]); - if (error) - return "services." + error; - } - } - if (message.warehouses != null && message.hasOwnProperty("warehouses")) { - if (!Array.isArray(message.warehouses)) - return "warehouses: array expected"; - for (var i = 0; i < message.warehouses.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Warehouse.verify(message.warehouses[i]); - if (error) - return "warehouses." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - return null; - }; - - /** - * Creates a ShippingSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.ShippingSettings} ShippingSettings - */ - ShippingSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.ShippingSettings) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.ShippingSettings(); - if (object.name != null) - message.name = String(object.name); - if (object.services) { - if (!Array.isArray(object.services)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ShippingSettings.services: array expected"); - message.services = []; - for (var i = 0; i < object.services.length; ++i) { - if (typeof object.services[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ShippingSettings.services: object expected"); - message.services[i] = $root.google.shopping.merchant.accounts.v1beta.Service.fromObject(object.services[i]); - } - } - if (object.warehouses) { - if (!Array.isArray(object.warehouses)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.ShippingSettings.warehouses: array expected"); - message.warehouses = []; - for (var i = 0; i < object.warehouses.length; ++i) { - if (typeof object.warehouses[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.ShippingSettings.warehouses: object expected"); - message.warehouses[i] = $root.google.shopping.merchant.accounts.v1beta.Warehouse.fromObject(object.warehouses[i]); - } - } - if (object.etag != null) - message.etag = String(object.etag); - return message; - }; - - /** - * Creates a plain object from a ShippingSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @static - * @param {google.shopping.merchant.accounts.v1beta.ShippingSettings} message ShippingSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShippingSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.services = []; - object.warehouses = []; - } - if (options.defaults) { - object.name = ""; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.services && message.services.length) { - object.services = []; - for (var j = 0; j < message.services.length; ++j) - object.services[j] = $root.google.shopping.merchant.accounts.v1beta.Service.toObject(message.services[j], options); - } - if (message.warehouses && message.warehouses.length) { - object.warehouses = []; - for (var j = 0; j < message.warehouses.length; ++j) - object.warehouses[j] = $root.google.shopping.merchant.accounts.v1beta.Warehouse.toObject(message.warehouses[j], options); - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - return object; - }; - - /** - * Converts this ShippingSettings to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @instance - * @returns {Object.} JSON object - */ - ShippingSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShippingSettings - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.ShippingSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShippingSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.ShippingSettings"; - }; - - return ShippingSettings; - })(); - - v1beta.Service = (function() { - - /** - * Properties of a Service. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IService - * @property {string|null} [serviceName] Service serviceName - * @property {boolean|null} [active] Service active - * @property {Array.|null} [deliveryCountries] Service deliveryCountries - * @property {string|null} [currencyCode] Service currencyCode - * @property {google.shopping.merchant.accounts.v1beta.IDeliveryTime|null} [deliveryTime] Service deliveryTime - * @property {Array.|null} [rateGroups] Service rateGroups - * @property {google.shopping.merchant.accounts.v1beta.Service.ShipmentType|null} [shipmentType] Service shipmentType - * @property {google.shopping.type.IPrice|null} [minimumOrderValue] Service minimumOrderValue - * @property {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable|null} [minimumOrderValueTable] Service minimumOrderValueTable - * @property {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig|null} [storeConfig] Service storeConfig - * @property {Array.|null} [loyaltyPrograms] Service loyaltyPrograms - */ - - /** - * Constructs a new Service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Service. - * @implements IService - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IService=} [properties] Properties to set - */ - function Service(properties) { - this.deliveryCountries = []; - this.rateGroups = []; - this.loyaltyPrograms = []; - 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]]; - } - - /** - * Service serviceName. - * @member {string|null|undefined} serviceName - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.serviceName = null; - - /** - * Service active. - * @member {boolean|null|undefined} active - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.active = null; - - /** - * Service deliveryCountries. - * @member {Array.} deliveryCountries - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.deliveryCountries = $util.emptyArray; - - /** - * Service currencyCode. - * @member {string|null|undefined} currencyCode - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.currencyCode = null; - - /** - * Service deliveryTime. - * @member {google.shopping.merchant.accounts.v1beta.IDeliveryTime|null|undefined} deliveryTime - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.deliveryTime = null; - - /** - * Service rateGroups. - * @member {Array.} rateGroups - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.rateGroups = $util.emptyArray; - - /** - * Service shipmentType. - * @member {google.shopping.merchant.accounts.v1beta.Service.ShipmentType|null|undefined} shipmentType - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.shipmentType = null; - - /** - * Service minimumOrderValue. - * @member {google.shopping.type.IPrice|null|undefined} minimumOrderValue - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.minimumOrderValue = null; - - /** - * Service minimumOrderValueTable. - * @member {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable|null|undefined} minimumOrderValueTable - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.minimumOrderValueTable = null; - - /** - * Service storeConfig. - * @member {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig|null|undefined} storeConfig - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.storeConfig = null; - - /** - * Service loyaltyPrograms. - * @member {Array.} loyaltyPrograms - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Service.prototype.loyaltyPrograms = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Service _serviceName. - * @member {"serviceName"|undefined} _serviceName - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Object.defineProperty(Service.prototype, "_serviceName", { - get: $util.oneOfGetter($oneOfFields = ["serviceName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Service _active. - * @member {"active"|undefined} _active - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Object.defineProperty(Service.prototype, "_active", { - get: $util.oneOfGetter($oneOfFields = ["active"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Service _currencyCode. - * @member {"currencyCode"|undefined} _currencyCode - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Object.defineProperty(Service.prototype, "_currencyCode", { - get: $util.oneOfGetter($oneOfFields = ["currencyCode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Service _deliveryTime. - * @member {"deliveryTime"|undefined} _deliveryTime - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Object.defineProperty(Service.prototype, "_deliveryTime", { - get: $util.oneOfGetter($oneOfFields = ["deliveryTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Service _shipmentType. - * @member {"shipmentType"|undefined} _shipmentType - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Object.defineProperty(Service.prototype, "_shipmentType", { - get: $util.oneOfGetter($oneOfFields = ["shipmentType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Service _minimumOrderValue. - * @member {"minimumOrderValue"|undefined} _minimumOrderValue - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Object.defineProperty(Service.prototype, "_minimumOrderValue", { - get: $util.oneOfGetter($oneOfFields = ["minimumOrderValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Service _minimumOrderValueTable. - * @member {"minimumOrderValueTable"|undefined} _minimumOrderValueTable - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Object.defineProperty(Service.prototype, "_minimumOrderValueTable", { - get: $util.oneOfGetter($oneOfFields = ["minimumOrderValueTable"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Service _storeConfig. - * @member {"storeConfig"|undefined} _storeConfig - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - */ - Object.defineProperty(Service.prototype, "_storeConfig", { - get: $util.oneOfGetter($oneOfFields = ["storeConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Service instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @static - * @param {google.shopping.merchant.accounts.v1beta.IService=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Service} Service instance - */ - Service.create = function create(properties) { - return new Service(properties); - }; - - /** - * Encodes the specified Service message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @static - * @param {google.shopping.merchant.accounts.v1beta.IService} message Service message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Service.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); - if (message.active != null && Object.hasOwnProperty.call(message, "active")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.active); - if (message.deliveryCountries != null && message.deliveryCountries.length) - for (var i = 0; i < message.deliveryCountries.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deliveryCountries[i]); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.currencyCode); - if (message.deliveryTime != null && Object.hasOwnProperty.call(message, "deliveryTime")) - $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.encode(message.deliveryTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.rateGroups != null && message.rateGroups.length) - for (var i = 0; i < message.rateGroups.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.RateGroup.encode(message.rateGroups[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.shipmentType != null && Object.hasOwnProperty.call(message, "shipmentType")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.shipmentType); - if (message.minimumOrderValue != null && Object.hasOwnProperty.call(message, "minimumOrderValue")) - $root.google.shopping.type.Price.encode(message.minimumOrderValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.minimumOrderValueTable != null && Object.hasOwnProperty.call(message, "minimumOrderValueTable")) - $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.encode(message.minimumOrderValueTable, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.storeConfig != null && Object.hasOwnProperty.call(message, "storeConfig")) - $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.encode(message.storeConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.loyaltyPrograms != null && message.loyaltyPrograms.length) - for (var i = 0; i < message.loyaltyPrograms.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.encode(message.loyaltyPrograms[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Service message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @static - * @param {google.shopping.merchant.accounts.v1beta.IService} message Service message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Service.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Service message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @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.Service} Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Service.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.Service(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.serviceName = reader.string(); - break; - } - case 2: { - message.active = reader.bool(); - break; - } - case 3: { - if (!(message.deliveryCountries && message.deliveryCountries.length)) - message.deliveryCountries = []; - message.deliveryCountries.push(reader.string()); - break; - } - case 4: { - message.currencyCode = reader.string(); - break; - } - case 5: { - message.deliveryTime = $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.rateGroups && message.rateGroups.length)) - message.rateGroups = []; - message.rateGroups.push($root.google.shopping.merchant.accounts.v1beta.RateGroup.decode(reader, reader.uint32())); - break; - } - case 7: { - message.shipmentType = reader.int32(); - break; - } - case 8: { - message.minimumOrderValue = $root.google.shopping.type.Price.decode(reader, reader.uint32()); - break; - } - case 9: { - message.minimumOrderValueTable = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.decode(reader, reader.uint32()); - break; - } - case 10: { - message.storeConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - if (!(message.loyaltyPrograms && message.loyaltyPrograms.length)) - message.loyaltyPrograms = []; - message.loyaltyPrograms.push($root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Service message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Service} Service - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Service.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Service message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Service.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.serviceName != null && message.hasOwnProperty("serviceName")) { - properties._serviceName = 1; - if (!$util.isString(message.serviceName)) - return "serviceName: string expected"; - } - if (message.active != null && message.hasOwnProperty("active")) { - properties._active = 1; - if (typeof message.active !== "boolean") - return "active: boolean expected"; - } - if (message.deliveryCountries != null && message.hasOwnProperty("deliveryCountries")) { - if (!Array.isArray(message.deliveryCountries)) - return "deliveryCountries: array expected"; - for (var i = 0; i < message.deliveryCountries.length; ++i) - if (!$util.isString(message.deliveryCountries[i])) - return "deliveryCountries: string[] expected"; - } - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { - properties._currencyCode = 1; - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; - } - if (message.deliveryTime != null && message.hasOwnProperty("deliveryTime")) { - properties._deliveryTime = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.verify(message.deliveryTime); - if (error) - return "deliveryTime." + error; - } - } - if (message.rateGroups != null && message.hasOwnProperty("rateGroups")) { - if (!Array.isArray(message.rateGroups)) - return "rateGroups: array expected"; - for (var i = 0; i < message.rateGroups.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.RateGroup.verify(message.rateGroups[i]); - if (error) - return "rateGroups." + error; - } - } - if (message.shipmentType != null && message.hasOwnProperty("shipmentType")) { - properties._shipmentType = 1; - switch (message.shipmentType) { - default: - return "shipmentType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.minimumOrderValue != null && message.hasOwnProperty("minimumOrderValue")) { - properties._minimumOrderValue = 1; - { - var error = $root.google.shopping.type.Price.verify(message.minimumOrderValue); - if (error) - return "minimumOrderValue." + error; - } - } - if (message.minimumOrderValueTable != null && message.hasOwnProperty("minimumOrderValueTable")) { - properties._minimumOrderValueTable = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify(message.minimumOrderValueTable); - if (error) - return "minimumOrderValueTable." + error; - } - } - if (message.storeConfig != null && message.hasOwnProperty("storeConfig")) { - properties._storeConfig = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify(message.storeConfig); - if (error) - return "storeConfig." + error; - } - } - if (message.loyaltyPrograms != null && message.hasOwnProperty("loyaltyPrograms")) { - if (!Array.isArray(message.loyaltyPrograms)) - return "loyaltyPrograms: array expected"; - for (var i = 0; i < message.loyaltyPrograms.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify(message.loyaltyPrograms[i]); - if (error) - return "loyaltyPrograms." + error; - } - } - return null; - }; - - /** - * Creates a Service message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Service} Service - */ - Service.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Service(); - if (object.serviceName != null) - message.serviceName = String(object.serviceName); - if (object.active != null) - message.active = Boolean(object.active); - if (object.deliveryCountries) { - if (!Array.isArray(object.deliveryCountries)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.deliveryCountries: array expected"); - message.deliveryCountries = []; - for (var i = 0; i < object.deliveryCountries.length; ++i) - message.deliveryCountries[i] = String(object.deliveryCountries[i]); - } - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); - if (object.deliveryTime != null) { - if (typeof object.deliveryTime !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.deliveryTime: object expected"); - message.deliveryTime = $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.fromObject(object.deliveryTime); - } - if (object.rateGroups) { - if (!Array.isArray(object.rateGroups)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.rateGroups: array expected"); - message.rateGroups = []; - for (var i = 0; i < object.rateGroups.length; ++i) { - if (typeof object.rateGroups[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.rateGroups: object expected"); - message.rateGroups[i] = $root.google.shopping.merchant.accounts.v1beta.RateGroup.fromObject(object.rateGroups[i]); - } - } - switch (object.shipmentType) { - default: - if (typeof object.shipmentType === "number") { - message.shipmentType = object.shipmentType; - break; - } - break; - case "SHIPMENT_TYPE_UNSPECIFIED": - case 0: - message.shipmentType = 0; - break; - case "DELIVERY": - case 1: - message.shipmentType = 1; - break; - case "LOCAL_DELIVERY": - case 2: - message.shipmentType = 2; - break; - case "COLLECTION_POINT": - case 3: - message.shipmentType = 3; - break; - } - if (object.minimumOrderValue != null) { - if (typeof object.minimumOrderValue !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.minimumOrderValue: object expected"); - message.minimumOrderValue = $root.google.shopping.type.Price.fromObject(object.minimumOrderValue); - } - if (object.minimumOrderValueTable != null) { - if (typeof object.minimumOrderValueTable !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.minimumOrderValueTable: object expected"); - message.minimumOrderValueTable = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.fromObject(object.minimumOrderValueTable); - } - if (object.storeConfig != null) { - if (typeof object.storeConfig !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.storeConfig: object expected"); - message.storeConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.fromObject(object.storeConfig); - } - if (object.loyaltyPrograms) { - if (!Array.isArray(object.loyaltyPrograms)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.loyaltyPrograms: array expected"); - message.loyaltyPrograms = []; - for (var i = 0; i < object.loyaltyPrograms.length; ++i) { - if (typeof object.loyaltyPrograms[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.loyaltyPrograms: object expected"); - message.loyaltyPrograms[i] = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.fromObject(object.loyaltyPrograms[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Service message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service} message Service - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Service.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.deliveryCountries = []; - object.rateGroups = []; - object.loyaltyPrograms = []; - } - if (message.serviceName != null && message.hasOwnProperty("serviceName")) { - object.serviceName = message.serviceName; - if (options.oneofs) - object._serviceName = "serviceName"; - } - if (message.active != null && message.hasOwnProperty("active")) { - object.active = message.active; - if (options.oneofs) - object._active = "active"; - } - if (message.deliveryCountries && message.deliveryCountries.length) { - object.deliveryCountries = []; - for (var j = 0; j < message.deliveryCountries.length; ++j) - object.deliveryCountries[j] = message.deliveryCountries[j]; - } - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { - object.currencyCode = message.currencyCode; - if (options.oneofs) - object._currencyCode = "currencyCode"; - } - if (message.deliveryTime != null && message.hasOwnProperty("deliveryTime")) { - object.deliveryTime = $root.google.shopping.merchant.accounts.v1beta.DeliveryTime.toObject(message.deliveryTime, options); - if (options.oneofs) - object._deliveryTime = "deliveryTime"; - } - if (message.rateGroups && message.rateGroups.length) { - object.rateGroups = []; - for (var j = 0; j < message.rateGroups.length; ++j) - object.rateGroups[j] = $root.google.shopping.merchant.accounts.v1beta.RateGroup.toObject(message.rateGroups[j], options); - } - if (message.shipmentType != null && message.hasOwnProperty("shipmentType")) { - object.shipmentType = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.Service.ShipmentType[message.shipmentType] === undefined ? message.shipmentType : $root.google.shopping.merchant.accounts.v1beta.Service.ShipmentType[message.shipmentType] : message.shipmentType; - if (options.oneofs) - object._shipmentType = "shipmentType"; - } - if (message.minimumOrderValue != null && message.hasOwnProperty("minimumOrderValue")) { - object.minimumOrderValue = $root.google.shopping.type.Price.toObject(message.minimumOrderValue, options); - if (options.oneofs) - object._minimumOrderValue = "minimumOrderValue"; - } - if (message.minimumOrderValueTable != null && message.hasOwnProperty("minimumOrderValueTable")) { - object.minimumOrderValueTable = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.toObject(message.minimumOrderValueTable, options); - if (options.oneofs) - object._minimumOrderValueTable = "minimumOrderValueTable"; - } - if (message.storeConfig != null && message.hasOwnProperty("storeConfig")) { - object.storeConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.toObject(message.storeConfig, options); - if (options.oneofs) - object._storeConfig = "storeConfig"; - } - if (message.loyaltyPrograms && message.loyaltyPrograms.length) { - object.loyaltyPrograms = []; - for (var j = 0; j < message.loyaltyPrograms.length; ++j) - object.loyaltyPrograms[j] = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.toObject(message.loyaltyPrograms[j], options); - } - return object; - }; - - /** - * Converts this Service to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @instance - * @returns {Object.} JSON object - */ - Service.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Service - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Service.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service"; - }; - - Service.StoreConfig = (function() { - - /** - * Properties of a StoreConfig. - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @interface IStoreConfig - * @property {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|null} [storeServiceType] StoreConfig storeServiceType - * @property {Array.|null} [storeCodes] StoreConfig storeCodes - * @property {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig|null} [cutoffConfig] StoreConfig cutoffConfig - * @property {google.shopping.merchant.accounts.v1beta.IDistance|null} [serviceRadius] StoreConfig serviceRadius - */ - - /** - * Constructs a new StoreConfig. - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @classdesc Represents a StoreConfig. - * @implements IStoreConfig - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig=} [properties] Properties to set - */ - function StoreConfig(properties) { - this.storeCodes = []; - 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]]; - } - - /** - * StoreConfig storeServiceType. - * @member {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType|null|undefined} storeServiceType - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @instance - */ - StoreConfig.prototype.storeServiceType = null; - - /** - * StoreConfig storeCodes. - * @member {Array.} storeCodes - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @instance - */ - StoreConfig.prototype.storeCodes = $util.emptyArray; - - /** - * StoreConfig cutoffConfig. - * @member {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig|null|undefined} cutoffConfig - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @instance - */ - StoreConfig.prototype.cutoffConfig = null; - - /** - * StoreConfig serviceRadius. - * @member {google.shopping.merchant.accounts.v1beta.IDistance|null|undefined} serviceRadius - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @instance - */ - StoreConfig.prototype.serviceRadius = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * StoreConfig _storeServiceType. - * @member {"storeServiceType"|undefined} _storeServiceType - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @instance - */ - Object.defineProperty(StoreConfig.prototype, "_storeServiceType", { - get: $util.oneOfGetter($oneOfFields = ["storeServiceType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * StoreConfig _cutoffConfig. - * @member {"cutoffConfig"|undefined} _cutoffConfig - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @instance - */ - Object.defineProperty(StoreConfig.prototype, "_cutoffConfig", { - get: $util.oneOfGetter($oneOfFields = ["cutoffConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * StoreConfig _serviceRadius. - * @member {"serviceRadius"|undefined} _serviceRadius - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @instance - */ - Object.defineProperty(StoreConfig.prototype, "_serviceRadius", { - get: $util.oneOfGetter($oneOfFields = ["serviceRadius"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new StoreConfig instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig} StoreConfig instance - */ - StoreConfig.create = function create(properties) { - return new StoreConfig(properties); - }; - - /** - * Encodes the specified StoreConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig} message StoreConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StoreConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.storeServiceType != null && Object.hasOwnProperty.call(message, "storeServiceType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.storeServiceType); - if (message.storeCodes != null && message.storeCodes.length) - for (var i = 0; i < message.storeCodes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.storeCodes[i]); - if (message.cutoffConfig != null && Object.hasOwnProperty.call(message, "cutoffConfig")) - $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.encode(message.cutoffConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.serviceRadius != null && Object.hasOwnProperty.call(message, "serviceRadius")) - $root.google.shopping.merchant.accounts.v1beta.Distance.encode(message.serviceRadius, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StoreConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.IStoreConfig} message StoreConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StoreConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StoreConfig message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @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.Service.StoreConfig} StoreConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StoreConfig.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.Service.StoreConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.storeServiceType = reader.int32(); - break; - } - case 2: { - if (!(message.storeCodes && message.storeCodes.length)) - message.storeCodes = []; - message.storeCodes.push(reader.string()); - break; - } - case 3: { - message.cutoffConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.serviceRadius = $root.google.shopping.merchant.accounts.v1beta.Distance.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StoreConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig} StoreConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StoreConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StoreConfig message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StoreConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.storeServiceType != null && message.hasOwnProperty("storeServiceType")) { - properties._storeServiceType = 1; - switch (message.storeServiceType) { - default: - return "storeServiceType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.storeCodes != null && message.hasOwnProperty("storeCodes")) { - if (!Array.isArray(message.storeCodes)) - return "storeCodes: array expected"; - for (var i = 0; i < message.storeCodes.length; ++i) - if (!$util.isString(message.storeCodes[i])) - return "storeCodes: string[] expected"; - } - if (message.cutoffConfig != null && message.hasOwnProperty("cutoffConfig")) { - properties._cutoffConfig = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify(message.cutoffConfig); - if (error) - return "cutoffConfig." + error; - } - } - if (message.serviceRadius != null && message.hasOwnProperty("serviceRadius")) { - properties._serviceRadius = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Distance.verify(message.serviceRadius); - if (error) - return "serviceRadius." + error; - } - } - return null; - }; - - /** - * Creates a StoreConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig} StoreConfig - */ - StoreConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig(); - switch (object.storeServiceType) { - default: - if (typeof object.storeServiceType === "number") { - message.storeServiceType = object.storeServiceType; - break; - } - break; - case "STORE_SERVICE_TYPE_UNSPECIFIED": - case 0: - message.storeServiceType = 0; - break; - case "ALL_STORES": - case 1: - message.storeServiceType = 1; - break; - case "SELECTED_STORES": - case 2: - message.storeServiceType = 2; - break; - } - if (object.storeCodes) { - if (!Array.isArray(object.storeCodes)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.StoreConfig.storeCodes: array expected"); - message.storeCodes = []; - for (var i = 0; i < object.storeCodes.length; ++i) - message.storeCodes[i] = String(object.storeCodes[i]); - } - if (object.cutoffConfig != null) { - if (typeof object.cutoffConfig !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.StoreConfig.cutoffConfig: object expected"); - message.cutoffConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.fromObject(object.cutoffConfig); - } - if (object.serviceRadius != null) { - if (typeof object.serviceRadius !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.StoreConfig.serviceRadius: object expected"); - message.serviceRadius = $root.google.shopping.merchant.accounts.v1beta.Distance.fromObject(object.serviceRadius); - } - return message; - }; - - /** - * Creates a plain object from a StoreConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig} message StoreConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StoreConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.storeCodes = []; - if (message.storeServiceType != null && message.hasOwnProperty("storeServiceType")) { - object.storeServiceType = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType[message.storeServiceType] === undefined ? message.storeServiceType : $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType[message.storeServiceType] : message.storeServiceType; - if (options.oneofs) - object._storeServiceType = "storeServiceType"; - } - if (message.storeCodes && message.storeCodes.length) { - object.storeCodes = []; - for (var j = 0; j < message.storeCodes.length; ++j) - object.storeCodes[j] = message.storeCodes[j]; - } - if (message.cutoffConfig != null && message.hasOwnProperty("cutoffConfig")) { - object.cutoffConfig = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.toObject(message.cutoffConfig, options); - if (options.oneofs) - object._cutoffConfig = "cutoffConfig"; - } - if (message.serviceRadius != null && message.hasOwnProperty("serviceRadius")) { - object.serviceRadius = $root.google.shopping.merchant.accounts.v1beta.Distance.toObject(message.serviceRadius, options); - if (options.oneofs) - object._serviceRadius = "serviceRadius"; - } - return object; - }; - - /** - * Converts this StoreConfig to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @instance - * @returns {Object.} JSON object - */ - StoreConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StoreConfig - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StoreConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.StoreConfig"; - }; - - StoreConfig.CutoffConfig = (function() { - - /** - * Properties of a CutoffConfig. - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @interface ICutoffConfig - * @property {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime|null} [localCutoffTime] CutoffConfig localCutoffTime - * @property {number|Long|null} [storeCloseOffsetHours] CutoffConfig storeCloseOffsetHours - * @property {boolean|null} [noDeliveryPostCutoff] CutoffConfig noDeliveryPostCutoff - */ - - /** - * Constructs a new CutoffConfig. - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig - * @classdesc Represents a CutoffConfig. - * @implements ICutoffConfig - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig=} [properties] Properties to set - */ - function CutoffConfig(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]]; - } - - /** - * CutoffConfig localCutoffTime. - * @member {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime|null|undefined} localCutoffTime - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @instance - */ - CutoffConfig.prototype.localCutoffTime = null; - - /** - * CutoffConfig storeCloseOffsetHours. - * @member {number|Long|null|undefined} storeCloseOffsetHours - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @instance - */ - CutoffConfig.prototype.storeCloseOffsetHours = null; - - /** - * CutoffConfig noDeliveryPostCutoff. - * @member {boolean|null|undefined} noDeliveryPostCutoff - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @instance - */ - CutoffConfig.prototype.noDeliveryPostCutoff = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CutoffConfig _localCutoffTime. - * @member {"localCutoffTime"|undefined} _localCutoffTime - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @instance - */ - Object.defineProperty(CutoffConfig.prototype, "_localCutoffTime", { - get: $util.oneOfGetter($oneOfFields = ["localCutoffTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CutoffConfig _storeCloseOffsetHours. - * @member {"storeCloseOffsetHours"|undefined} _storeCloseOffsetHours - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @instance - */ - Object.defineProperty(CutoffConfig.prototype, "_storeCloseOffsetHours", { - get: $util.oneOfGetter($oneOfFields = ["storeCloseOffsetHours"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CutoffConfig _noDeliveryPostCutoff. - * @member {"noDeliveryPostCutoff"|undefined} _noDeliveryPostCutoff - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @instance - */ - Object.defineProperty(CutoffConfig.prototype, "_noDeliveryPostCutoff", { - get: $util.oneOfGetter($oneOfFields = ["noDeliveryPostCutoff"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CutoffConfig instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig} CutoffConfig instance - */ - CutoffConfig.create = function create(properties) { - return new CutoffConfig(properties); - }; - - /** - * Encodes the specified CutoffConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig} message CutoffConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CutoffConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.localCutoffTime != null && Object.hasOwnProperty.call(message, "localCutoffTime")) - $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.encode(message.localCutoffTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.storeCloseOffsetHours != null && Object.hasOwnProperty.call(message, "storeCloseOffsetHours")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.storeCloseOffsetHours); - if (message.noDeliveryPostCutoff != null && Object.hasOwnProperty.call(message, "noDeliveryPostCutoff")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.noDeliveryPostCutoff); - return writer; - }; - - /** - * Encodes the specified CutoffConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.ICutoffConfig} message CutoffConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CutoffConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CutoffConfig message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @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.Service.StoreConfig.CutoffConfig} CutoffConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CutoffConfig.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.Service.StoreConfig.CutoffConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.localCutoffTime = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.decode(reader, reader.uint32()); - break; - } - case 2: { - message.storeCloseOffsetHours = reader.int64(); - break; - } - case 3: { - message.noDeliveryPostCutoff = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CutoffConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig} CutoffConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CutoffConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CutoffConfig message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CutoffConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.localCutoffTime != null && message.hasOwnProperty("localCutoffTime")) { - properties._localCutoffTime = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify(message.localCutoffTime); - if (error) - return "localCutoffTime." + error; - } - } - if (message.storeCloseOffsetHours != null && message.hasOwnProperty("storeCloseOffsetHours")) { - properties._storeCloseOffsetHours = 1; - if (!$util.isInteger(message.storeCloseOffsetHours) && !(message.storeCloseOffsetHours && $util.isInteger(message.storeCloseOffsetHours.low) && $util.isInteger(message.storeCloseOffsetHours.high))) - return "storeCloseOffsetHours: integer|Long expected"; - } - if (message.noDeliveryPostCutoff != null && message.hasOwnProperty("noDeliveryPostCutoff")) { - properties._noDeliveryPostCutoff = 1; - if (typeof message.noDeliveryPostCutoff !== "boolean") - return "noDeliveryPostCutoff: boolean expected"; - } - return null; - }; - - /** - * Creates a CutoffConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig} CutoffConfig - */ - CutoffConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig(); - if (object.localCutoffTime != null) { - if (typeof object.localCutoffTime !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.localCutoffTime: object expected"); - message.localCutoffTime = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.fromObject(object.localCutoffTime); - } - if (object.storeCloseOffsetHours != null) - if ($util.Long) - (message.storeCloseOffsetHours = $util.Long.fromValue(object.storeCloseOffsetHours)).unsigned = false; - else if (typeof object.storeCloseOffsetHours === "string") - message.storeCloseOffsetHours = parseInt(object.storeCloseOffsetHours, 10); - else if (typeof object.storeCloseOffsetHours === "number") - message.storeCloseOffsetHours = object.storeCloseOffsetHours; - else if (typeof object.storeCloseOffsetHours === "object") - message.storeCloseOffsetHours = new $util.LongBits(object.storeCloseOffsetHours.low >>> 0, object.storeCloseOffsetHours.high >>> 0).toNumber(); - if (object.noDeliveryPostCutoff != null) - message.noDeliveryPostCutoff = Boolean(object.noDeliveryPostCutoff); - return message; - }; - - /** - * Creates a plain object from a CutoffConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig} message CutoffConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CutoffConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.localCutoffTime != null && message.hasOwnProperty("localCutoffTime")) { - object.localCutoffTime = $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.toObject(message.localCutoffTime, options); - if (options.oneofs) - object._localCutoffTime = "localCutoffTime"; - } - if (message.storeCloseOffsetHours != null && message.hasOwnProperty("storeCloseOffsetHours")) { - if (typeof message.storeCloseOffsetHours === "number") - object.storeCloseOffsetHours = options.longs === String ? String(message.storeCloseOffsetHours) : message.storeCloseOffsetHours; - else - object.storeCloseOffsetHours = options.longs === String ? $util.Long.prototype.toString.call(message.storeCloseOffsetHours) : options.longs === Number ? new $util.LongBits(message.storeCloseOffsetHours.low >>> 0, message.storeCloseOffsetHours.high >>> 0).toNumber() : message.storeCloseOffsetHours; - if (options.oneofs) - object._storeCloseOffsetHours = "storeCloseOffsetHours"; - } - if (message.noDeliveryPostCutoff != null && message.hasOwnProperty("noDeliveryPostCutoff")) { - object.noDeliveryPostCutoff = message.noDeliveryPostCutoff; - if (options.oneofs) - object._noDeliveryPostCutoff = "noDeliveryPostCutoff"; - } - return object; - }; - - /** - * Converts this CutoffConfig to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @instance - * @returns {Object.} JSON object - */ - CutoffConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CutoffConfig - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CutoffConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig"; - }; - - CutoffConfig.LocalCutoffTime = (function() { - - /** - * Properties of a LocalCutoffTime. - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @interface ILocalCutoffTime - * @property {number|Long|null} [hour] LocalCutoffTime hour - * @property {number|Long|null} [minute] LocalCutoffTime minute - */ - - /** - * Constructs a new LocalCutoffTime. - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig - * @classdesc Represents a LocalCutoffTime. - * @implements ILocalCutoffTime - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime=} [properties] Properties to set - */ - function LocalCutoffTime(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]]; - } - - /** - * LocalCutoffTime hour. - * @member {number|Long|null|undefined} hour - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @instance - */ - LocalCutoffTime.prototype.hour = null; - - /** - * LocalCutoffTime minute. - * @member {number|Long|null|undefined} minute - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @instance - */ - LocalCutoffTime.prototype.minute = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LocalCutoffTime _hour. - * @member {"hour"|undefined} _hour - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @instance - */ - Object.defineProperty(LocalCutoffTime.prototype, "_hour", { - get: $util.oneOfGetter($oneOfFields = ["hour"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * LocalCutoffTime _minute. - * @member {"minute"|undefined} _minute - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @instance - */ - Object.defineProperty(LocalCutoffTime.prototype, "_minute", { - get: $util.oneOfGetter($oneOfFields = ["minute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LocalCutoffTime instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime} LocalCutoffTime instance - */ - LocalCutoffTime.create = function create(properties) { - return new LocalCutoffTime(properties); - }; - - /** - * Encodes the specified LocalCutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime} message LocalCutoffTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocalCutoffTime.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.hour); - if (message.minute != null && Object.hasOwnProperty.call(message, "minute")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.minute); - return writer; - }; - - /** - * Encodes the specified LocalCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.ILocalCutoffTime} message LocalCutoffTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocalCutoffTime.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocalCutoffTime message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @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.Service.StoreConfig.CutoffConfig.LocalCutoffTime} LocalCutoffTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocalCutoffTime.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.Service.StoreConfig.CutoffConfig.LocalCutoffTime(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.hour = reader.int64(); - break; - } - case 2: { - message.minute = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocalCutoffTime message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime} LocalCutoffTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocalCutoffTime.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocalCutoffTime message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocalCutoffTime.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.hour != null && message.hasOwnProperty("hour")) { - properties._hour = 1; - if (!$util.isInteger(message.hour) && !(message.hour && $util.isInteger(message.hour.low) && $util.isInteger(message.hour.high))) - return "hour: integer|Long expected"; - } - if (message.minute != null && message.hasOwnProperty("minute")) { - properties._minute = 1; - if (!$util.isInteger(message.minute) && !(message.minute && $util.isInteger(message.minute.low) && $util.isInteger(message.minute.high))) - return "minute: integer|Long expected"; - } - return null; - }; - - /** - * Creates a LocalCutoffTime message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime} LocalCutoffTime - */ - LocalCutoffTime.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime(); - if (object.hour != null) - if ($util.Long) - (message.hour = $util.Long.fromValue(object.hour)).unsigned = false; - else if (typeof object.hour === "string") - message.hour = parseInt(object.hour, 10); - else if (typeof object.hour === "number") - message.hour = object.hour; - else if (typeof object.hour === "object") - message.hour = new $util.LongBits(object.hour.low >>> 0, object.hour.high >>> 0).toNumber(); - if (object.minute != null) - if ($util.Long) - (message.minute = $util.Long.fromValue(object.minute)).unsigned = false; - else if (typeof object.minute === "string") - message.minute = parseInt(object.minute, 10); - else if (typeof object.minute === "number") - message.minute = object.minute; - else if (typeof object.minute === "object") - message.minute = new $util.LongBits(object.minute.low >>> 0, object.minute.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a LocalCutoffTime message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime} message LocalCutoffTime - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocalCutoffTime.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.hour != null && message.hasOwnProperty("hour")) { - if (typeof message.hour === "number") - object.hour = options.longs === String ? String(message.hour) : message.hour; - else - object.hour = options.longs === String ? $util.Long.prototype.toString.call(message.hour) : options.longs === Number ? new $util.LongBits(message.hour.low >>> 0, message.hour.high >>> 0).toNumber() : message.hour; - if (options.oneofs) - object._hour = "hour"; - } - if (message.minute != null && message.hasOwnProperty("minute")) { - if (typeof message.minute === "number") - object.minute = options.longs === String ? String(message.minute) : message.minute; - else - object.minute = options.longs === String ? $util.Long.prototype.toString.call(message.minute) : options.longs === Number ? new $util.LongBits(message.minute.low >>> 0, message.minute.high >>> 0).toNumber() : message.minute; - if (options.oneofs) - object._minute = "minute"; - } - return object; - }; - - /** - * Converts this LocalCutoffTime to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @instance - * @returns {Object.} JSON object - */ - LocalCutoffTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocalCutoffTime - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocalCutoffTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.StoreConfig.CutoffConfig.LocalCutoffTime"; - }; - - return LocalCutoffTime; - })(); - - return CutoffConfig; - })(); - - /** - * StoreServiceType enum. - * @name google.shopping.merchant.accounts.v1beta.Service.StoreConfig.StoreServiceType - * @enum {number} - * @property {number} STORE_SERVICE_TYPE_UNSPECIFIED=0 STORE_SERVICE_TYPE_UNSPECIFIED value - * @property {number} ALL_STORES=1 ALL_STORES value - * @property {number} SELECTED_STORES=2 SELECTED_STORES value - */ - StoreConfig.StoreServiceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STORE_SERVICE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALL_STORES"] = 1; - values[valuesById[2] = "SELECTED_STORES"] = 2; - return values; - })(); - - return StoreConfig; - })(); - - Service.LoyaltyProgram = (function() { - - /** - * Properties of a LoyaltyProgram. - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @interface ILoyaltyProgram - * @property {string|null} [programLabel] LoyaltyProgram programLabel - * @property {Array.|null} [loyaltyProgramTiers] LoyaltyProgram loyaltyProgramTiers - */ - - /** - * Constructs a new LoyaltyProgram. - * @memberof google.shopping.merchant.accounts.v1beta.Service - * @classdesc Represents a LoyaltyProgram. - * @implements ILoyaltyProgram - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram=} [properties] Properties to set - */ - function LoyaltyProgram(properties) { - this.loyaltyProgramTiers = []; - 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]]; - } - - /** - * LoyaltyProgram programLabel. - * @member {string|null|undefined} programLabel - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @instance - */ - LoyaltyProgram.prototype.programLabel = null; - - /** - * LoyaltyProgram loyaltyProgramTiers. - * @member {Array.} loyaltyProgramTiers - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @instance - */ - LoyaltyProgram.prototype.loyaltyProgramTiers = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LoyaltyProgram _programLabel. - * @member {"programLabel"|undefined} _programLabel - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @instance - */ - Object.defineProperty(LoyaltyProgram.prototype, "_programLabel", { - get: $util.oneOfGetter($oneOfFields = ["programLabel"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LoyaltyProgram instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram} LoyaltyProgram instance - */ - LoyaltyProgram.create = function create(properties) { - return new LoyaltyProgram(properties); - }; - - /** - * Encodes the specified LoyaltyProgram message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram} message LoyaltyProgram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoyaltyProgram.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.programLabel != null && Object.hasOwnProperty.call(message, "programLabel")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.programLabel); - if (message.loyaltyProgramTiers != null && message.loyaltyProgramTiers.length) - for (var i = 0; i < message.loyaltyProgramTiers.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.encode(message.loyaltyProgramTiers[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LoyaltyProgram message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.ILoyaltyProgram} message LoyaltyProgram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoyaltyProgram.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LoyaltyProgram message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @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.Service.LoyaltyProgram} LoyaltyProgram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoyaltyProgram.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.Service.LoyaltyProgram(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.programLabel = reader.string(); - break; - } - case 2: { - if (!(message.loyaltyProgramTiers && message.loyaltyProgramTiers.length)) - message.loyaltyProgramTiers = []; - message.loyaltyProgramTiers.push($root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LoyaltyProgram message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram} LoyaltyProgram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoyaltyProgram.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LoyaltyProgram message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LoyaltyProgram.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.programLabel != null && message.hasOwnProperty("programLabel")) { - properties._programLabel = 1; - if (!$util.isString(message.programLabel)) - return "programLabel: string expected"; - } - if (message.loyaltyProgramTiers != null && message.hasOwnProperty("loyaltyProgramTiers")) { - if (!Array.isArray(message.loyaltyProgramTiers)) - return "loyaltyProgramTiers: array expected"; - for (var i = 0; i < message.loyaltyProgramTiers.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify(message.loyaltyProgramTiers[i]); - if (error) - return "loyaltyProgramTiers." + error; - } - } - return null; - }; - - /** - * Creates a LoyaltyProgram message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram} LoyaltyProgram - */ - LoyaltyProgram.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram(); - if (object.programLabel != null) - message.programLabel = String(object.programLabel); - if (object.loyaltyProgramTiers) { - if (!Array.isArray(object.loyaltyProgramTiers)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.loyaltyProgramTiers: array expected"); - message.loyaltyProgramTiers = []; - for (var i = 0; i < object.loyaltyProgramTiers.length; ++i) { - if (typeof object.loyaltyProgramTiers[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.loyaltyProgramTiers: object expected"); - message.loyaltyProgramTiers[i] = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.fromObject(object.loyaltyProgramTiers[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a LoyaltyProgram message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram} message LoyaltyProgram - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LoyaltyProgram.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.loyaltyProgramTiers = []; - if (message.programLabel != null && message.hasOwnProperty("programLabel")) { - object.programLabel = message.programLabel; - if (options.oneofs) - object._programLabel = "programLabel"; - } - if (message.loyaltyProgramTiers && message.loyaltyProgramTiers.length) { - object.loyaltyProgramTiers = []; - for (var j = 0; j < message.loyaltyProgramTiers.length; ++j) - object.loyaltyProgramTiers[j] = $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.toObject(message.loyaltyProgramTiers[j], options); - } - return object; - }; - - /** - * Converts this LoyaltyProgram to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @instance - * @returns {Object.} JSON object - */ - LoyaltyProgram.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LoyaltyProgram - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LoyaltyProgram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram"; - }; - - LoyaltyProgram.LoyaltyProgramTiers = (function() { - - /** - * Properties of a LoyaltyProgramTiers. - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @interface ILoyaltyProgramTiers - * @property {string|null} [tierLabel] LoyaltyProgramTiers tierLabel - */ - - /** - * Constructs a new LoyaltyProgramTiers. - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram - * @classdesc Represents a LoyaltyProgramTiers. - * @implements ILoyaltyProgramTiers - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers=} [properties] Properties to set - */ - function LoyaltyProgramTiers(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]]; - } - - /** - * LoyaltyProgramTiers tierLabel. - * @member {string|null|undefined} tierLabel - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @instance - */ - LoyaltyProgramTiers.prototype.tierLabel = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LoyaltyProgramTiers _tierLabel. - * @member {"tierLabel"|undefined} _tierLabel - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @instance - */ - Object.defineProperty(LoyaltyProgramTiers.prototype, "_tierLabel", { - get: $util.oneOfGetter($oneOfFields = ["tierLabel"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LoyaltyProgramTiers instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers} LoyaltyProgramTiers instance - */ - LoyaltyProgramTiers.create = function create(properties) { - return new LoyaltyProgramTiers(properties); - }; - - /** - * Encodes the specified LoyaltyProgramTiers message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers} message LoyaltyProgramTiers message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoyaltyProgramTiers.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tierLabel != null && Object.hasOwnProperty.call(message, "tierLabel")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tierLabel); - return writer; - }; - - /** - * Encodes the specified LoyaltyProgramTiers message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.ILoyaltyProgramTiers} message LoyaltyProgramTiers message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoyaltyProgramTiers.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LoyaltyProgramTiers message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @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.Service.LoyaltyProgram.LoyaltyProgramTiers} LoyaltyProgramTiers - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoyaltyProgramTiers.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.Service.LoyaltyProgram.LoyaltyProgramTiers(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.tierLabel = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LoyaltyProgramTiers message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers} LoyaltyProgramTiers - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoyaltyProgramTiers.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LoyaltyProgramTiers message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LoyaltyProgramTiers.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.tierLabel != null && message.hasOwnProperty("tierLabel")) { - properties._tierLabel = 1; - if (!$util.isString(message.tierLabel)) - return "tierLabel: string expected"; - } - return null; - }; - - /** - * Creates a LoyaltyProgramTiers message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers} LoyaltyProgramTiers - */ - LoyaltyProgramTiers.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers(); - if (object.tierLabel != null) - message.tierLabel = String(object.tierLabel); - return message; - }; - - /** - * Creates a plain object from a LoyaltyProgramTiers message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @static - * @param {google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers} message LoyaltyProgramTiers - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LoyaltyProgramTiers.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.tierLabel != null && message.hasOwnProperty("tierLabel")) { - object.tierLabel = message.tierLabel; - if (options.oneofs) - object._tierLabel = "tierLabel"; - } - return object; - }; - - /** - * Converts this LoyaltyProgramTiers to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @instance - * @returns {Object.} JSON object - */ - LoyaltyProgramTiers.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LoyaltyProgramTiers - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LoyaltyProgramTiers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Service.LoyaltyProgram.LoyaltyProgramTiers"; - }; - - return LoyaltyProgramTiers; - })(); - - return LoyaltyProgram; - })(); - - /** - * ShipmentType enum. - * @name google.shopping.merchant.accounts.v1beta.Service.ShipmentType - * @enum {number} - * @property {number} SHIPMENT_TYPE_UNSPECIFIED=0 SHIPMENT_TYPE_UNSPECIFIED value - * @property {number} DELIVERY=1 DELIVERY value - * @property {number} LOCAL_DELIVERY=2 LOCAL_DELIVERY value - * @property {number} COLLECTION_POINT=3 COLLECTION_POINT value - */ - Service.ShipmentType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SHIPMENT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DELIVERY"] = 1; - values[valuesById[2] = "LOCAL_DELIVERY"] = 2; - values[valuesById[3] = "COLLECTION_POINT"] = 3; - return values; - })(); - - return Service; - })(); - - v1beta.Distance = (function() { - - /** - * Properties of a Distance. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IDistance - * @property {number|Long|null} [value] Distance value - * @property {google.shopping.merchant.accounts.v1beta.Distance.Unit|null} [unit] Distance unit - */ - - /** - * Constructs a new Distance. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Distance. - * @implements IDistance - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IDistance=} [properties] Properties to set - */ - function Distance(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]]; - } - - /** - * Distance value. - * @member {number|Long|null|undefined} value - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @instance - */ - Distance.prototype.value = null; - - /** - * Distance unit. - * @member {google.shopping.merchant.accounts.v1beta.Distance.Unit|null|undefined} unit - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @instance - */ - Distance.prototype.unit = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Distance _value. - * @member {"value"|undefined} _value - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @instance - */ - Object.defineProperty(Distance.prototype, "_value", { - get: $util.oneOfGetter($oneOfFields = ["value"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Distance _unit. - * @member {"unit"|undefined} _unit - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @instance - */ - Object.defineProperty(Distance.prototype, "_unit", { - get: $util.oneOfGetter($oneOfFields = ["unit"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Distance instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDistance=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Distance} Distance instance - */ - Distance.create = function create(properties) { - return new Distance(properties); - }; - - /** - * Encodes the specified Distance message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Distance.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDistance} message Distance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Distance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unit); - return writer; - }; - - /** - * Encodes the specified Distance message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Distance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDistance} message Distance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Distance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Distance message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @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.Distance} Distance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Distance.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.Distance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.int64(); - break; - } - case 2: { - message.unit = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Distance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Distance} Distance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Distance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Distance message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Distance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties._value = 1; - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - } - if (message.unit != null && message.hasOwnProperty("unit")) { - properties._unit = 1; - switch (message.unit) { - default: - return "unit: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - return null; - }; - - /** - * Creates a Distance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Distance} Distance - */ - Distance.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Distance) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Distance(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - switch (object.unit) { - default: - if (typeof object.unit === "number") { - message.unit = object.unit; - break; - } - break; - case "UNIT_UNSPECIFIED": - case 0: - message.unit = 0; - break; - case "MILES": - case 1: - message.unit = 1; - break; - case "KILOMETERS": - case 2: - message.unit = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a Distance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @static - * @param {google.shopping.merchant.accounts.v1beta.Distance} message Distance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Distance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.value != null && message.hasOwnProperty("value")) { - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - if (options.oneofs) - object._value = "value"; - } - if (message.unit != null && message.hasOwnProperty("unit")) { - object.unit = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.Distance.Unit[message.unit] === undefined ? message.unit : $root.google.shopping.merchant.accounts.v1beta.Distance.Unit[message.unit] : message.unit; - if (options.oneofs) - object._unit = "unit"; - } - return object; - }; - - /** - * Converts this Distance to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @instance - * @returns {Object.} JSON object - */ - Distance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Distance - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Distance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Distance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Distance"; - }; - - /** - * Unit enum. - * @name google.shopping.merchant.accounts.v1beta.Distance.Unit - * @enum {number} - * @property {number} UNIT_UNSPECIFIED=0 UNIT_UNSPECIFIED value - * @property {number} MILES=1 MILES value - * @property {number} KILOMETERS=2 KILOMETERS value - */ - Distance.Unit = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNIT_UNSPECIFIED"] = 0; - values[valuesById[1] = "MILES"] = 1; - values[valuesById[2] = "KILOMETERS"] = 2; - return values; - })(); - - return Distance; - })(); - - v1beta.Warehouse = (function() { - - /** - * Properties of a Warehouse. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IWarehouse - * @property {string|null} [name] Warehouse name - * @property {google.shopping.merchant.accounts.v1beta.IAddress|null} [shippingAddress] Warehouse shippingAddress - * @property {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime|null} [cutoffTime] Warehouse cutoffTime - * @property {number|Long|null} [handlingDays] Warehouse handlingDays - * @property {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null} [businessDayConfig] Warehouse businessDayConfig - */ - - /** - * Constructs a new Warehouse. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Warehouse. - * @implements IWarehouse - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IWarehouse=} [properties] Properties to set - */ - function Warehouse(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]]; - } - - /** - * Warehouse name. - * @member {string|null|undefined} name - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Warehouse.prototype.name = null; - - /** - * Warehouse shippingAddress. - * @member {google.shopping.merchant.accounts.v1beta.IAddress|null|undefined} shippingAddress - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Warehouse.prototype.shippingAddress = null; - - /** - * Warehouse cutoffTime. - * @member {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime|null|undefined} cutoffTime - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Warehouse.prototype.cutoffTime = null; - - /** - * Warehouse handlingDays. - * @member {number|Long|null|undefined} handlingDays - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Warehouse.prototype.handlingDays = null; - - /** - * Warehouse businessDayConfig. - * @member {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null|undefined} businessDayConfig - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Warehouse.prototype.businessDayConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Warehouse _name. - * @member {"name"|undefined} _name - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Object.defineProperty(Warehouse.prototype, "_name", { - get: $util.oneOfGetter($oneOfFields = ["name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Warehouse _shippingAddress. - * @member {"shippingAddress"|undefined} _shippingAddress - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Object.defineProperty(Warehouse.prototype, "_shippingAddress", { - get: $util.oneOfGetter($oneOfFields = ["shippingAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Warehouse _cutoffTime. - * @member {"cutoffTime"|undefined} _cutoffTime - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Object.defineProperty(Warehouse.prototype, "_cutoffTime", { - get: $util.oneOfGetter($oneOfFields = ["cutoffTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Warehouse _handlingDays. - * @member {"handlingDays"|undefined} _handlingDays - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Object.defineProperty(Warehouse.prototype, "_handlingDays", { - get: $util.oneOfGetter($oneOfFields = ["handlingDays"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Warehouse _businessDayConfig. - * @member {"businessDayConfig"|undefined} _businessDayConfig - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - */ - Object.defineProperty(Warehouse.prototype, "_businessDayConfig", { - get: $util.oneOfGetter($oneOfFields = ["businessDayConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Warehouse instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IWarehouse=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Warehouse} Warehouse instance - */ - Warehouse.create = function create(properties) { - return new Warehouse(properties); - }; - - /** - * Encodes the specified Warehouse message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Warehouse.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IWarehouse} message Warehouse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Warehouse.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.shippingAddress != null && Object.hasOwnProperty.call(message, "shippingAddress")) - $root.google.shopping.merchant.accounts.v1beta.Address.encode(message.shippingAddress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cutoffTime != null && Object.hasOwnProperty.call(message, "cutoffTime")) - $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.encode(message.cutoffTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.handlingDays != null && Object.hasOwnProperty.call(message, "handlingDays")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.handlingDays); - if (message.businessDayConfig != null && Object.hasOwnProperty.call(message, "businessDayConfig")) - $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.encode(message.businessDayConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Warehouse message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Warehouse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @static - * @param {google.shopping.merchant.accounts.v1beta.IWarehouse} message Warehouse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Warehouse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Warehouse message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @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.Warehouse} Warehouse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Warehouse.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.Warehouse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.shippingAddress = $root.google.shopping.merchant.accounts.v1beta.Address.decode(reader, reader.uint32()); - break; - } - case 3: { - message.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.decode(reader, reader.uint32()); - break; - } - case 4: { - message.handlingDays = reader.int64(); - break; - } - case 5: { - message.businessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Warehouse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Warehouse} Warehouse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Warehouse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Warehouse message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Warehouse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) { - properties._name = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - if (message.shippingAddress != null && message.hasOwnProperty("shippingAddress")) { - properties._shippingAddress = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Address.verify(message.shippingAddress); - if (error) - return "shippingAddress." + error; - } - } - if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { - properties._cutoffTime = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify(message.cutoffTime); - if (error) - return "cutoffTime." + error; - } - } - if (message.handlingDays != null && message.hasOwnProperty("handlingDays")) { - properties._handlingDays = 1; - if (!$util.isInteger(message.handlingDays) && !(message.handlingDays && $util.isInteger(message.handlingDays.low) && $util.isInteger(message.handlingDays.high))) - return "handlingDays: integer|Long expected"; - } - if (message.businessDayConfig != null && message.hasOwnProperty("businessDayConfig")) { - properties._businessDayConfig = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify(message.businessDayConfig); - if (error) - return "businessDayConfig." + error; - } - } - return null; - }; - - /** - * Creates a Warehouse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Warehouse} Warehouse - */ - Warehouse.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Warehouse) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Warehouse(); - if (object.name != null) - message.name = String(object.name); - if (object.shippingAddress != null) { - if (typeof object.shippingAddress !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Warehouse.shippingAddress: object expected"); - message.shippingAddress = $root.google.shopping.merchant.accounts.v1beta.Address.fromObject(object.shippingAddress); - } - if (object.cutoffTime != null) { - if (typeof object.cutoffTime !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Warehouse.cutoffTime: object expected"); - message.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.fromObject(object.cutoffTime); - } - if (object.handlingDays != null) - if ($util.Long) - (message.handlingDays = $util.Long.fromValue(object.handlingDays)).unsigned = false; - else if (typeof object.handlingDays === "string") - message.handlingDays = parseInt(object.handlingDays, 10); - else if (typeof object.handlingDays === "number") - message.handlingDays = object.handlingDays; - else if (typeof object.handlingDays === "object") - message.handlingDays = new $util.LongBits(object.handlingDays.low >>> 0, object.handlingDays.high >>> 0).toNumber(); - if (object.businessDayConfig != null) { - if (typeof object.businessDayConfig !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Warehouse.businessDayConfig: object expected"); - message.businessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.fromObject(object.businessDayConfig); - } - return message; - }; - - /** - * Creates a plain object from a Warehouse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @static - * @param {google.shopping.merchant.accounts.v1beta.Warehouse} message Warehouse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Warehouse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object._name = "name"; - } - if (message.shippingAddress != null && message.hasOwnProperty("shippingAddress")) { - object.shippingAddress = $root.google.shopping.merchant.accounts.v1beta.Address.toObject(message.shippingAddress, options); - if (options.oneofs) - object._shippingAddress = "shippingAddress"; - } - if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { - object.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.toObject(message.cutoffTime, options); - if (options.oneofs) - object._cutoffTime = "cutoffTime"; - } - if (message.handlingDays != null && message.hasOwnProperty("handlingDays")) { - if (typeof message.handlingDays === "number") - object.handlingDays = options.longs === String ? String(message.handlingDays) : message.handlingDays; - else - object.handlingDays = options.longs === String ? $util.Long.prototype.toString.call(message.handlingDays) : options.longs === Number ? new $util.LongBits(message.handlingDays.low >>> 0, message.handlingDays.high >>> 0).toNumber() : message.handlingDays; - if (options.oneofs) - object._handlingDays = "handlingDays"; - } - if (message.businessDayConfig != null && message.hasOwnProperty("businessDayConfig")) { - object.businessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.toObject(message.businessDayConfig, options); - if (options.oneofs) - object._businessDayConfig = "businessDayConfig"; - } - return object; - }; - - /** - * Converts this Warehouse to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @instance - * @returns {Object.} JSON object - */ - Warehouse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Warehouse - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Warehouse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Warehouse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Warehouse"; - }; - - return Warehouse; - })(); - - v1beta.WarehouseCutoffTime = (function() { - - /** - * Properties of a WarehouseCutoffTime. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IWarehouseCutoffTime - * @property {number|null} [hour] WarehouseCutoffTime hour - * @property {number|null} [minute] WarehouseCutoffTime minute - */ - - /** - * Constructs a new WarehouseCutoffTime. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a WarehouseCutoffTime. - * @implements IWarehouseCutoffTime - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime=} [properties] Properties to set - */ - function WarehouseCutoffTime(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]]; - } - - /** - * WarehouseCutoffTime hour. - * @member {number|null|undefined} hour - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @instance - */ - WarehouseCutoffTime.prototype.hour = null; - - /** - * WarehouseCutoffTime minute. - * @member {number|null|undefined} minute - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @instance - */ - WarehouseCutoffTime.prototype.minute = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WarehouseCutoffTime _hour. - * @member {"hour"|undefined} _hour - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @instance - */ - Object.defineProperty(WarehouseCutoffTime.prototype, "_hour", { - get: $util.oneOfGetter($oneOfFields = ["hour"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * WarehouseCutoffTime _minute. - * @member {"minute"|undefined} _minute - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @instance - */ - Object.defineProperty(WarehouseCutoffTime.prototype, "_minute", { - get: $util.oneOfGetter($oneOfFields = ["minute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WarehouseCutoffTime instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime} WarehouseCutoffTime instance - */ - WarehouseCutoffTime.create = function create(properties) { - return new WarehouseCutoffTime(properties); - }; - - /** - * Encodes the specified WarehouseCutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime} message WarehouseCutoffTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WarehouseCutoffTime.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hour); - if (message.minute != null && Object.hasOwnProperty.call(message, "minute")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minute); - return writer; - }; - - /** - * Encodes the specified WarehouseCutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.IWarehouseCutoffTime} message WarehouseCutoffTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WarehouseCutoffTime.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WarehouseCutoffTime message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @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.WarehouseCutoffTime} WarehouseCutoffTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WarehouseCutoffTime.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.WarehouseCutoffTime(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.hour = reader.int32(); - break; - } - case 2: { - message.minute = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WarehouseCutoffTime message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime} WarehouseCutoffTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WarehouseCutoffTime.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WarehouseCutoffTime message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WarehouseCutoffTime.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.hour != null && message.hasOwnProperty("hour")) { - properties._hour = 1; - if (!$util.isInteger(message.hour)) - return "hour: integer expected"; - } - if (message.minute != null && message.hasOwnProperty("minute")) { - properties._minute = 1; - if (!$util.isInteger(message.minute)) - return "minute: integer expected"; - } - return null; - }; - - /** - * Creates a WarehouseCutoffTime message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime} WarehouseCutoffTime - */ - WarehouseCutoffTime.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime(); - if (object.hour != null) - message.hour = object.hour | 0; - if (object.minute != null) - message.minute = object.minute | 0; - return message; - }; - - /** - * Creates a plain object from a WarehouseCutoffTime message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime} message WarehouseCutoffTime - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WarehouseCutoffTime.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.hour != null && message.hasOwnProperty("hour")) { - object.hour = message.hour; - if (options.oneofs) - object._hour = "hour"; - } - if (message.minute != null && message.hasOwnProperty("minute")) { - object.minute = message.minute; - if (options.oneofs) - object._minute = "minute"; - } - return object; - }; - - /** - * Converts this WarehouseCutoffTime to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @instance - * @returns {Object.} JSON object - */ - WarehouseCutoffTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WarehouseCutoffTime - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WarehouseCutoffTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.WarehouseCutoffTime"; - }; - - return WarehouseCutoffTime; - })(); - - v1beta.Address = (function() { - - /** - * Properties of an Address. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IAddress - * @property {string|null} [streetAddress] Address streetAddress - * @property {string|null} [city] Address city - * @property {string|null} [administrativeArea] Address administrativeArea - * @property {string|null} [postalCode] Address postalCode - * @property {string|null} [regionCode] Address regionCode - */ - - /** - * Constructs a new Address. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an Address. - * @implements IAddress - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IAddress=} [properties] Properties to set - */ - function Address(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]]; - } - - /** - * Address streetAddress. - * @member {string|null|undefined} streetAddress - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Address.prototype.streetAddress = null; - - /** - * Address city. - * @member {string|null|undefined} city - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Address.prototype.city = null; - - /** - * Address administrativeArea. - * @member {string|null|undefined} administrativeArea - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Address.prototype.administrativeArea = null; - - /** - * Address postalCode. - * @member {string|null|undefined} postalCode - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Address.prototype.postalCode = null; - - /** - * Address regionCode. - * @member {string|null|undefined} regionCode - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Address.prototype.regionCode = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Address _streetAddress. - * @member {"streetAddress"|undefined} _streetAddress - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Object.defineProperty(Address.prototype, "_streetAddress", { - get: $util.oneOfGetter($oneOfFields = ["streetAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Address _city. - * @member {"city"|undefined} _city - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Object.defineProperty(Address.prototype, "_city", { - get: $util.oneOfGetter($oneOfFields = ["city"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Address _administrativeArea. - * @member {"administrativeArea"|undefined} _administrativeArea - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Object.defineProperty(Address.prototype, "_administrativeArea", { - get: $util.oneOfGetter($oneOfFields = ["administrativeArea"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Address _postalCode. - * @member {"postalCode"|undefined} _postalCode - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Object.defineProperty(Address.prototype, "_postalCode", { - get: $util.oneOfGetter($oneOfFields = ["postalCode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Address _regionCode. - * @member {"regionCode"|undefined} _regionCode - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - */ - Object.defineProperty(Address.prototype, "_regionCode", { - get: $util.oneOfGetter($oneOfFields = ["regionCode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Address instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAddress=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Address} Address instance - */ - Address.create = function create(properties) { - return new Address(properties); - }; - - /** - * Encodes the specified Address message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Address.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAddress} message Address message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Address.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.streetAddress != null && Object.hasOwnProperty.call(message, "streetAddress")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.streetAddress); - if (message.city != null && Object.hasOwnProperty.call(message, "city")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.city); - if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.administrativeArea); - if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCode); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.regionCode); - return writer; - }; - - /** - * Encodes the specified Address message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Address.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAddress} message Address message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Address.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Address message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @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.Address} Address - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Address.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.Address(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.streetAddress = reader.string(); - break; - } - case 2: { - message.city = reader.string(); - break; - } - case 3: { - message.administrativeArea = reader.string(); - break; - } - case 4: { - message.postalCode = reader.string(); - break; - } - case 5: { - message.regionCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Address message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Address} Address - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Address.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Address message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Address.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) { - properties._streetAddress = 1; - if (!$util.isString(message.streetAddress)) - return "streetAddress: string expected"; - } - if (message.city != null && message.hasOwnProperty("city")) { - properties._city = 1; - if (!$util.isString(message.city)) - return "city: string expected"; - } - if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) { - properties._administrativeArea = 1; - if (!$util.isString(message.administrativeArea)) - return "administrativeArea: string expected"; - } - if (message.postalCode != null && message.hasOwnProperty("postalCode")) { - properties._postalCode = 1; - if (!$util.isString(message.postalCode)) - return "postalCode: string expected"; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) { - properties._regionCode = 1; - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - } - return null; - }; - - /** - * Creates an Address message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Address} Address - */ - Address.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Address) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Address(); - if (object.streetAddress != null) - message.streetAddress = String(object.streetAddress); - if (object.city != null) - message.city = String(object.city); - if (object.administrativeArea != null) - message.administrativeArea = String(object.administrativeArea); - if (object.postalCode != null) - message.postalCode = String(object.postalCode); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - return message; - }; - - /** - * Creates a plain object from an Address message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @static - * @param {google.shopping.merchant.accounts.v1beta.Address} message Address - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Address.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.streetAddress != null && message.hasOwnProperty("streetAddress")) { - object.streetAddress = message.streetAddress; - if (options.oneofs) - object._streetAddress = "streetAddress"; - } - if (message.city != null && message.hasOwnProperty("city")) { - object.city = message.city; - if (options.oneofs) - object._city = "city"; - } - if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) { - object.administrativeArea = message.administrativeArea; - if (options.oneofs) - object._administrativeArea = "administrativeArea"; - } - if (message.postalCode != null && message.hasOwnProperty("postalCode")) { - object.postalCode = message.postalCode; - if (options.oneofs) - object._postalCode = "postalCode"; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) { - object.regionCode = message.regionCode; - if (options.oneofs) - object._regionCode = "regionCode"; - } - return object; - }; - - /** - * Converts this Address to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @instance - * @returns {Object.} JSON object - */ - Address.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Address - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Address - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Address.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Address"; - }; - - return Address; - })(); - - v1beta.DeliveryTime = (function() { - - /** - * Properties of a DeliveryTime. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IDeliveryTime - * @property {number|null} [minTransitDays] DeliveryTime minTransitDays - * @property {number|null} [maxTransitDays] DeliveryTime maxTransitDays - * @property {google.shopping.merchant.accounts.v1beta.ICutoffTime|null} [cutoffTime] DeliveryTime cutoffTime - * @property {number|null} [minHandlingDays] DeliveryTime minHandlingDays - * @property {number|null} [maxHandlingDays] DeliveryTime maxHandlingDays - * @property {google.shopping.merchant.accounts.v1beta.ITransitTable|null} [transitTimeTable] DeliveryTime transitTimeTable - * @property {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null} [handlingBusinessDayConfig] DeliveryTime handlingBusinessDayConfig - * @property {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null} [transitBusinessDayConfig] DeliveryTime transitBusinessDayConfig - * @property {Array.|null} [warehouseBasedDeliveryTimes] DeliveryTime warehouseBasedDeliveryTimes - */ - - /** - * Constructs a new DeliveryTime. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a DeliveryTime. - * @implements IDeliveryTime - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IDeliveryTime=} [properties] Properties to set - */ - function DeliveryTime(properties) { - this.warehouseBasedDeliveryTimes = []; - 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]]; - } - - /** - * DeliveryTime minTransitDays. - * @member {number|null|undefined} minTransitDays - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - DeliveryTime.prototype.minTransitDays = null; - - /** - * DeliveryTime maxTransitDays. - * @member {number|null|undefined} maxTransitDays - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - DeliveryTime.prototype.maxTransitDays = null; - - /** - * DeliveryTime cutoffTime. - * @member {google.shopping.merchant.accounts.v1beta.ICutoffTime|null|undefined} cutoffTime - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - DeliveryTime.prototype.cutoffTime = null; - - /** - * DeliveryTime minHandlingDays. - * @member {number|null|undefined} minHandlingDays - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - DeliveryTime.prototype.minHandlingDays = null; - - /** - * DeliveryTime maxHandlingDays. - * @member {number|null|undefined} maxHandlingDays - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - DeliveryTime.prototype.maxHandlingDays = null; - - /** - * DeliveryTime transitTimeTable. - * @member {google.shopping.merchant.accounts.v1beta.ITransitTable|null|undefined} transitTimeTable - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - DeliveryTime.prototype.transitTimeTable = null; - - /** - * DeliveryTime handlingBusinessDayConfig. - * @member {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null|undefined} handlingBusinessDayConfig - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - DeliveryTime.prototype.handlingBusinessDayConfig = null; - - /** - * DeliveryTime transitBusinessDayConfig. - * @member {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig|null|undefined} transitBusinessDayConfig - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - DeliveryTime.prototype.transitBusinessDayConfig = null; - - /** - * DeliveryTime warehouseBasedDeliveryTimes. - * @member {Array.} warehouseBasedDeliveryTimes - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - DeliveryTime.prototype.warehouseBasedDeliveryTimes = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DeliveryTime _minTransitDays. - * @member {"minTransitDays"|undefined} _minTransitDays - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - Object.defineProperty(DeliveryTime.prototype, "_minTransitDays", { - get: $util.oneOfGetter($oneOfFields = ["minTransitDays"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * DeliveryTime _maxTransitDays. - * @member {"maxTransitDays"|undefined} _maxTransitDays - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - Object.defineProperty(DeliveryTime.prototype, "_maxTransitDays", { - get: $util.oneOfGetter($oneOfFields = ["maxTransitDays"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * DeliveryTime _cutoffTime. - * @member {"cutoffTime"|undefined} _cutoffTime - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - Object.defineProperty(DeliveryTime.prototype, "_cutoffTime", { - get: $util.oneOfGetter($oneOfFields = ["cutoffTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * DeliveryTime _minHandlingDays. - * @member {"minHandlingDays"|undefined} _minHandlingDays - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - Object.defineProperty(DeliveryTime.prototype, "_minHandlingDays", { - get: $util.oneOfGetter($oneOfFields = ["minHandlingDays"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * DeliveryTime _maxHandlingDays. - * @member {"maxHandlingDays"|undefined} _maxHandlingDays - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - Object.defineProperty(DeliveryTime.prototype, "_maxHandlingDays", { - get: $util.oneOfGetter($oneOfFields = ["maxHandlingDays"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * DeliveryTime _transitTimeTable. - * @member {"transitTimeTable"|undefined} _transitTimeTable - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - Object.defineProperty(DeliveryTime.prototype, "_transitTimeTable", { - get: $util.oneOfGetter($oneOfFields = ["transitTimeTable"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * DeliveryTime _handlingBusinessDayConfig. - * @member {"handlingBusinessDayConfig"|undefined} _handlingBusinessDayConfig - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - Object.defineProperty(DeliveryTime.prototype, "_handlingBusinessDayConfig", { - get: $util.oneOfGetter($oneOfFields = ["handlingBusinessDayConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * DeliveryTime _transitBusinessDayConfig. - * @member {"transitBusinessDayConfig"|undefined} _transitBusinessDayConfig - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - */ - Object.defineProperty(DeliveryTime.prototype, "_transitBusinessDayConfig", { - get: $util.oneOfGetter($oneOfFields = ["transitBusinessDayConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DeliveryTime instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeliveryTime=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.DeliveryTime} DeliveryTime instance - */ - DeliveryTime.create = function create(properties) { - return new DeliveryTime(properties); - }; - - /** - * Encodes the specified DeliveryTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeliveryTime.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeliveryTime} message DeliveryTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeliveryTime.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minTransitDays != null && Object.hasOwnProperty.call(message, "minTransitDays")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minTransitDays); - if (message.maxTransitDays != null && Object.hasOwnProperty.call(message, "maxTransitDays")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxTransitDays); - if (message.cutoffTime != null && Object.hasOwnProperty.call(message, "cutoffTime")) - $root.google.shopping.merchant.accounts.v1beta.CutoffTime.encode(message.cutoffTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.minHandlingDays != null && Object.hasOwnProperty.call(message, "minHandlingDays")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minHandlingDays); - if (message.maxHandlingDays != null && Object.hasOwnProperty.call(message, "maxHandlingDays")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxHandlingDays); - if (message.transitTimeTable != null && Object.hasOwnProperty.call(message, "transitTimeTable")) - $root.google.shopping.merchant.accounts.v1beta.TransitTable.encode(message.transitTimeTable, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.handlingBusinessDayConfig != null && Object.hasOwnProperty.call(message, "handlingBusinessDayConfig")) - $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.encode(message.handlingBusinessDayConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.transitBusinessDayConfig != null && Object.hasOwnProperty.call(message, "transitBusinessDayConfig")) - $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.encode(message.transitBusinessDayConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.warehouseBasedDeliveryTimes != null && message.warehouseBasedDeliveryTimes.length) - for (var i = 0; i < message.warehouseBasedDeliveryTimes.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.encode(message.warehouseBasedDeliveryTimes[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeliveryTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.DeliveryTime.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.IDeliveryTime} message DeliveryTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeliveryTime.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeliveryTime message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @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.DeliveryTime} DeliveryTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeliveryTime.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.DeliveryTime(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.minTransitDays = reader.int32(); - break; - } - case 2: { - message.maxTransitDays = reader.int32(); - break; - } - case 3: { - message.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.CutoffTime.decode(reader, reader.uint32()); - break; - } - case 4: { - message.minHandlingDays = reader.int32(); - break; - } - case 5: { - message.maxHandlingDays = reader.int32(); - break; - } - case 6: { - message.transitTimeTable = $root.google.shopping.merchant.accounts.v1beta.TransitTable.decode(reader, reader.uint32()); - break; - } - case 7: { - message.handlingBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.transitBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.warehouseBasedDeliveryTimes && message.warehouseBasedDeliveryTimes.length)) - message.warehouseBasedDeliveryTimes = []; - message.warehouseBasedDeliveryTimes.push($root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeliveryTime message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.DeliveryTime} DeliveryTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeliveryTime.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeliveryTime message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeliveryTime.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.minTransitDays != null && message.hasOwnProperty("minTransitDays")) { - properties._minTransitDays = 1; - if (!$util.isInteger(message.minTransitDays)) - return "minTransitDays: integer expected"; - } - if (message.maxTransitDays != null && message.hasOwnProperty("maxTransitDays")) { - properties._maxTransitDays = 1; - if (!$util.isInteger(message.maxTransitDays)) - return "maxTransitDays: integer expected"; - } - if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { - properties._cutoffTime = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.CutoffTime.verify(message.cutoffTime); - if (error) - return "cutoffTime." + error; - } - } - if (message.minHandlingDays != null && message.hasOwnProperty("minHandlingDays")) { - properties._minHandlingDays = 1; - if (!$util.isInteger(message.minHandlingDays)) - return "minHandlingDays: integer expected"; - } - if (message.maxHandlingDays != null && message.hasOwnProperty("maxHandlingDays")) { - properties._maxHandlingDays = 1; - if (!$util.isInteger(message.maxHandlingDays)) - return "maxHandlingDays: integer expected"; - } - if (message.transitTimeTable != null && message.hasOwnProperty("transitTimeTable")) { - properties._transitTimeTable = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.TransitTable.verify(message.transitTimeTable); - if (error) - return "transitTimeTable." + error; - } - } - if (message.handlingBusinessDayConfig != null && message.hasOwnProperty("handlingBusinessDayConfig")) { - properties._handlingBusinessDayConfig = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify(message.handlingBusinessDayConfig); - if (error) - return "handlingBusinessDayConfig." + error; - } - } - if (message.transitBusinessDayConfig != null && message.hasOwnProperty("transitBusinessDayConfig")) { - properties._transitBusinessDayConfig = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify(message.transitBusinessDayConfig); - if (error) - return "transitBusinessDayConfig." + error; - } - } - if (message.warehouseBasedDeliveryTimes != null && message.hasOwnProperty("warehouseBasedDeliveryTimes")) { - if (!Array.isArray(message.warehouseBasedDeliveryTimes)) - return "warehouseBasedDeliveryTimes: array expected"; - for (var i = 0; i < message.warehouseBasedDeliveryTimes.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify(message.warehouseBasedDeliveryTimes[i]); - if (error) - return "warehouseBasedDeliveryTimes." + error; - } - } - return null; - }; - - /** - * Creates a DeliveryTime message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.DeliveryTime} DeliveryTime - */ - DeliveryTime.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.DeliveryTime) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.DeliveryTime(); - if (object.minTransitDays != null) - message.minTransitDays = object.minTransitDays | 0; - if (object.maxTransitDays != null) - message.maxTransitDays = object.maxTransitDays | 0; - if (object.cutoffTime != null) { - if (typeof object.cutoffTime !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.cutoffTime: object expected"); - message.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.CutoffTime.fromObject(object.cutoffTime); - } - if (object.minHandlingDays != null) - message.minHandlingDays = object.minHandlingDays | 0; - if (object.maxHandlingDays != null) - message.maxHandlingDays = object.maxHandlingDays | 0; - if (object.transitTimeTable != null) { - if (typeof object.transitTimeTable !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.transitTimeTable: object expected"); - message.transitTimeTable = $root.google.shopping.merchant.accounts.v1beta.TransitTable.fromObject(object.transitTimeTable); - } - if (object.handlingBusinessDayConfig != null) { - if (typeof object.handlingBusinessDayConfig !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.handlingBusinessDayConfig: object expected"); - message.handlingBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.fromObject(object.handlingBusinessDayConfig); - } - if (object.transitBusinessDayConfig != null) { - if (typeof object.transitBusinessDayConfig !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.transitBusinessDayConfig: object expected"); - message.transitBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.fromObject(object.transitBusinessDayConfig); - } - if (object.warehouseBasedDeliveryTimes) { - if (!Array.isArray(object.warehouseBasedDeliveryTimes)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.warehouseBasedDeliveryTimes: array expected"); - message.warehouseBasedDeliveryTimes = []; - for (var i = 0; i < object.warehouseBasedDeliveryTimes.length; ++i) { - if (typeof object.warehouseBasedDeliveryTimes[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.DeliveryTime.warehouseBasedDeliveryTimes: object expected"); - message.warehouseBasedDeliveryTimes[i] = $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.fromObject(object.warehouseBasedDeliveryTimes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DeliveryTime message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.DeliveryTime} message DeliveryTime - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeliveryTime.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.warehouseBasedDeliveryTimes = []; - if (message.minTransitDays != null && message.hasOwnProperty("minTransitDays")) { - object.minTransitDays = message.minTransitDays; - if (options.oneofs) - object._minTransitDays = "minTransitDays"; - } - if (message.maxTransitDays != null && message.hasOwnProperty("maxTransitDays")) { - object.maxTransitDays = message.maxTransitDays; - if (options.oneofs) - object._maxTransitDays = "maxTransitDays"; - } - if (message.cutoffTime != null && message.hasOwnProperty("cutoffTime")) { - object.cutoffTime = $root.google.shopping.merchant.accounts.v1beta.CutoffTime.toObject(message.cutoffTime, options); - if (options.oneofs) - object._cutoffTime = "cutoffTime"; - } - if (message.minHandlingDays != null && message.hasOwnProperty("minHandlingDays")) { - object.minHandlingDays = message.minHandlingDays; - if (options.oneofs) - object._minHandlingDays = "minHandlingDays"; - } - if (message.maxHandlingDays != null && message.hasOwnProperty("maxHandlingDays")) { - object.maxHandlingDays = message.maxHandlingDays; - if (options.oneofs) - object._maxHandlingDays = "maxHandlingDays"; - } - if (message.transitTimeTable != null && message.hasOwnProperty("transitTimeTable")) { - object.transitTimeTable = $root.google.shopping.merchant.accounts.v1beta.TransitTable.toObject(message.transitTimeTable, options); - if (options.oneofs) - object._transitTimeTable = "transitTimeTable"; - } - if (message.handlingBusinessDayConfig != null && message.hasOwnProperty("handlingBusinessDayConfig")) { - object.handlingBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.toObject(message.handlingBusinessDayConfig, options); - if (options.oneofs) - object._handlingBusinessDayConfig = "handlingBusinessDayConfig"; - } - if (message.transitBusinessDayConfig != null && message.hasOwnProperty("transitBusinessDayConfig")) { - object.transitBusinessDayConfig = $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.toObject(message.transitBusinessDayConfig, options); - if (options.oneofs) - object._transitBusinessDayConfig = "transitBusinessDayConfig"; - } - if (message.warehouseBasedDeliveryTimes && message.warehouseBasedDeliveryTimes.length) { - object.warehouseBasedDeliveryTimes = []; - for (var j = 0; j < message.warehouseBasedDeliveryTimes.length; ++j) - object.warehouseBasedDeliveryTimes[j] = $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.toObject(message.warehouseBasedDeliveryTimes[j], options); - } - return object; - }; - - /** - * Converts this DeliveryTime to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @instance - * @returns {Object.} JSON object - */ - DeliveryTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeliveryTime - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.DeliveryTime - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeliveryTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.DeliveryTime"; - }; - - return DeliveryTime; - })(); - - v1beta.CutoffTime = (function() { - - /** - * Properties of a CutoffTime. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ICutoffTime - * @property {number|null} [hour] CutoffTime hour - * @property {number|null} [minute] CutoffTime minute - * @property {string|null} [timeZone] CutoffTime timeZone - */ - - /** - * Constructs a new CutoffTime. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a CutoffTime. - * @implements ICutoffTime - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ICutoffTime=} [properties] Properties to set - */ - function CutoffTime(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]]; - } - - /** - * CutoffTime hour. - * @member {number|null|undefined} hour - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @instance - */ - CutoffTime.prototype.hour = null; - - /** - * CutoffTime minute. - * @member {number|null|undefined} minute - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @instance - */ - CutoffTime.prototype.minute = null; - - /** - * CutoffTime timeZone. - * @member {string|null|undefined} timeZone - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @instance - */ - CutoffTime.prototype.timeZone = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CutoffTime _hour. - * @member {"hour"|undefined} _hour - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @instance - */ - Object.defineProperty(CutoffTime.prototype, "_hour", { - get: $util.oneOfGetter($oneOfFields = ["hour"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CutoffTime _minute. - * @member {"minute"|undefined} _minute - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @instance - */ - Object.defineProperty(CutoffTime.prototype, "_minute", { - get: $util.oneOfGetter($oneOfFields = ["minute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CutoffTime _timeZone. - * @member {"timeZone"|undefined} _timeZone - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @instance - */ - Object.defineProperty(CutoffTime.prototype, "_timeZone", { - get: $util.oneOfGetter($oneOfFields = ["timeZone"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CutoffTime instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICutoffTime=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.CutoffTime} CutoffTime instance - */ - CutoffTime.create = function create(properties) { - return new CutoffTime(properties); - }; - - /** - * Encodes the specified CutoffTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CutoffTime.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICutoffTime} message CutoffTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CutoffTime.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hour); - if (message.minute != null && Object.hasOwnProperty.call(message, "minute")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minute); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeZone); - return writer; - }; - - /** - * Encodes the specified CutoffTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CutoffTime.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICutoffTime} message CutoffTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CutoffTime.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CutoffTime message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @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.CutoffTime} CutoffTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CutoffTime.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.CutoffTime(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.hour = reader.int32(); - break; - } - case 2: { - message.minute = reader.int32(); - break; - } - case 3: { - message.timeZone = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CutoffTime message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.CutoffTime} CutoffTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CutoffTime.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CutoffTime message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CutoffTime.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.hour != null && message.hasOwnProperty("hour")) { - properties._hour = 1; - if (!$util.isInteger(message.hour)) - return "hour: integer expected"; - } - if (message.minute != null && message.hasOwnProperty("minute")) { - properties._minute = 1; - if (!$util.isInteger(message.minute)) - return "minute: integer expected"; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) { - properties._timeZone = 1; - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - } - return null; - }; - - /** - * Creates a CutoffTime message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.CutoffTime} CutoffTime - */ - CutoffTime.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CutoffTime) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.CutoffTime(); - if (object.hour != null) - message.hour = object.hour | 0; - if (object.minute != null) - message.minute = object.minute | 0; - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - return message; - }; - - /** - * Creates a plain object from a CutoffTime message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.CutoffTime} message CutoffTime - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CutoffTime.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.hour != null && message.hasOwnProperty("hour")) { - object.hour = message.hour; - if (options.oneofs) - object._hour = "hour"; - } - if (message.minute != null && message.hasOwnProperty("minute")) { - object.minute = message.minute; - if (options.oneofs) - object._minute = "minute"; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) { - object.timeZone = message.timeZone; - if (options.oneofs) - object._timeZone = "timeZone"; - } - return object; - }; - - /** - * Converts this CutoffTime to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @instance - * @returns {Object.} JSON object - */ - CutoffTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CutoffTime - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.CutoffTime - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CutoffTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CutoffTime"; - }; - - return CutoffTime; - })(); - - v1beta.BusinessDayConfig = (function() { - - /** - * Properties of a BusinessDayConfig. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IBusinessDayConfig - * @property {Array.|null} [businessDays] BusinessDayConfig businessDays - */ - - /** - * Constructs a new BusinessDayConfig. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a BusinessDayConfig. - * @implements IBusinessDayConfig - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig=} [properties] Properties to set - */ - function BusinessDayConfig(properties) { - this.businessDays = []; - 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]]; - } - - /** - * BusinessDayConfig businessDays. - * @member {Array.} businessDays - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @instance - */ - BusinessDayConfig.prototype.businessDays = $util.emptyArray; - - /** - * Creates a new BusinessDayConfig instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.BusinessDayConfig} BusinessDayConfig instance - */ - BusinessDayConfig.create = function create(properties) { - return new BusinessDayConfig(properties); - }; - - /** - * Encodes the specified BusinessDayConfig message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig} message BusinessDayConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BusinessDayConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.businessDays != null && message.businessDays.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.businessDays.length; ++i) - writer.int32(message.businessDays[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified BusinessDayConfig message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.BusinessDayConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.IBusinessDayConfig} message BusinessDayConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BusinessDayConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BusinessDayConfig message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @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.BusinessDayConfig} BusinessDayConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BusinessDayConfig.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.BusinessDayConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.businessDays && message.businessDays.length)) - message.businessDays = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.businessDays.push(reader.int32()); - } else - message.businessDays.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BusinessDayConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.BusinessDayConfig} BusinessDayConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BusinessDayConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BusinessDayConfig message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BusinessDayConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.businessDays != null && message.hasOwnProperty("businessDays")) { - if (!Array.isArray(message.businessDays)) - return "businessDays: array expected"; - for (var i = 0; i < message.businessDays.length; ++i) - switch (message.businessDays[i]) { - default: - return "businessDays: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - return null; - }; - - /** - * Creates a BusinessDayConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.BusinessDayConfig} BusinessDayConfig - */ - BusinessDayConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig(); - if (object.businessDays) { - if (!Array.isArray(object.businessDays)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.BusinessDayConfig.businessDays: array expected"); - message.businessDays = []; - for (var i = 0; i < object.businessDays.length; ++i) - switch (object.businessDays[i]) { - default: - if (typeof object.businessDays[i] === "number") { - message.businessDays[i] = object.businessDays[i]; - break; - } - case "WEEKDAY_UNSPECIFIED": - case 0: - message.businessDays[i] = 0; - break; - case "MONDAY": - case 1: - message.businessDays[i] = 1; - break; - case "TUESDAY": - case 2: - message.businessDays[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.businessDays[i] = 3; - break; - case "THURSDAY": - case 4: - message.businessDays[i] = 4; - break; - case "FRIDAY": - case 5: - message.businessDays[i] = 5; - break; - case "SATURDAY": - case 6: - message.businessDays[i] = 6; - break; - case "SUNDAY": - case 7: - message.businessDays[i] = 7; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a BusinessDayConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @static - * @param {google.shopping.merchant.accounts.v1beta.BusinessDayConfig} message BusinessDayConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BusinessDayConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.businessDays = []; - if (message.businessDays && message.businessDays.length) { - object.businessDays = []; - for (var j = 0; j < message.businessDays.length; ++j) - object.businessDays[j] = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday[message.businessDays[j]] === undefined ? message.businessDays[j] : $root.google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday[message.businessDays[j]] : message.businessDays[j]; - } - return object; - }; - - /** - * Converts this BusinessDayConfig to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @instance - * @returns {Object.} JSON object - */ - BusinessDayConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BusinessDayConfig - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.BusinessDayConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BusinessDayConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.BusinessDayConfig"; - }; - - /** - * Weekday enum. - * @name google.shopping.merchant.accounts.v1beta.BusinessDayConfig.Weekday - * @enum {number} - * @property {number} WEEKDAY_UNSPECIFIED=0 WEEKDAY_UNSPECIFIED value - * @property {number} MONDAY=1 MONDAY value - * @property {number} TUESDAY=2 TUESDAY value - * @property {number} WEDNESDAY=3 WEDNESDAY value - * @property {number} THURSDAY=4 THURSDAY value - * @property {number} FRIDAY=5 FRIDAY value - * @property {number} SATURDAY=6 SATURDAY value - * @property {number} SUNDAY=7 SUNDAY value - */ - BusinessDayConfig.Weekday = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WEEKDAY_UNSPECIFIED"] = 0; - values[valuesById[1] = "MONDAY"] = 1; - values[valuesById[2] = "TUESDAY"] = 2; - values[valuesById[3] = "WEDNESDAY"] = 3; - values[valuesById[4] = "THURSDAY"] = 4; - values[valuesById[5] = "FRIDAY"] = 5; - values[valuesById[6] = "SATURDAY"] = 6; - values[valuesById[7] = "SUNDAY"] = 7; - return values; - })(); - - return BusinessDayConfig; - })(); - - v1beta.WarehouseBasedDeliveryTime = (function() { - - /** - * Properties of a WarehouseBasedDeliveryTime. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IWarehouseBasedDeliveryTime - * @property {string|null} [carrier] WarehouseBasedDeliveryTime carrier - * @property {string|null} [carrierService] WarehouseBasedDeliveryTime carrierService - * @property {string|null} [warehouse] WarehouseBasedDeliveryTime warehouse - */ - - /** - * Constructs a new WarehouseBasedDeliveryTime. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a WarehouseBasedDeliveryTime. - * @implements IWarehouseBasedDeliveryTime - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime=} [properties] Properties to set - */ - function WarehouseBasedDeliveryTime(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]]; - } - - /** - * WarehouseBasedDeliveryTime carrier. - * @member {string|null|undefined} carrier - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @instance - */ - WarehouseBasedDeliveryTime.prototype.carrier = null; - - /** - * WarehouseBasedDeliveryTime carrierService. - * @member {string|null|undefined} carrierService - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @instance - */ - WarehouseBasedDeliveryTime.prototype.carrierService = null; - - /** - * WarehouseBasedDeliveryTime warehouse. - * @member {string|null|undefined} warehouse - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @instance - */ - WarehouseBasedDeliveryTime.prototype.warehouse = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WarehouseBasedDeliveryTime _carrier. - * @member {"carrier"|undefined} _carrier - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @instance - */ - Object.defineProperty(WarehouseBasedDeliveryTime.prototype, "_carrier", { - get: $util.oneOfGetter($oneOfFields = ["carrier"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * WarehouseBasedDeliveryTime _carrierService. - * @member {"carrierService"|undefined} _carrierService - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @instance - */ - Object.defineProperty(WarehouseBasedDeliveryTime.prototype, "_carrierService", { - get: $util.oneOfGetter($oneOfFields = ["carrierService"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * WarehouseBasedDeliveryTime _warehouse. - * @member {"warehouse"|undefined} _warehouse - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @instance - */ - Object.defineProperty(WarehouseBasedDeliveryTime.prototype, "_warehouse", { - get: $util.oneOfGetter($oneOfFields = ["warehouse"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WarehouseBasedDeliveryTime instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime} WarehouseBasedDeliveryTime instance - */ - WarehouseBasedDeliveryTime.create = function create(properties) { - return new WarehouseBasedDeliveryTime(properties); - }; - - /** - * Encodes the specified WarehouseBasedDeliveryTime message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime} message WarehouseBasedDeliveryTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WarehouseBasedDeliveryTime.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.carrier != null && Object.hasOwnProperty.call(message, "carrier")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.carrier); - if (message.carrierService != null && Object.hasOwnProperty.call(message, "carrierService")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.carrierService); - if (message.warehouse != null && Object.hasOwnProperty.call(message, "warehouse")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.warehouse); - return writer; - }; - - /** - * Encodes the specified WarehouseBasedDeliveryTime message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.IWarehouseBasedDeliveryTime} message WarehouseBasedDeliveryTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WarehouseBasedDeliveryTime.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WarehouseBasedDeliveryTime message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @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.WarehouseBasedDeliveryTime} WarehouseBasedDeliveryTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WarehouseBasedDeliveryTime.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.WarehouseBasedDeliveryTime(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.carrier = reader.string(); - break; - } - case 2: { - message.carrierService = reader.string(); - break; - } - case 3: { - message.warehouse = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WarehouseBasedDeliveryTime message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime} WarehouseBasedDeliveryTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WarehouseBasedDeliveryTime.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WarehouseBasedDeliveryTime message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WarehouseBasedDeliveryTime.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.carrier != null && message.hasOwnProperty("carrier")) { - properties._carrier = 1; - if (!$util.isString(message.carrier)) - return "carrier: string expected"; - } - if (message.carrierService != null && message.hasOwnProperty("carrierService")) { - properties._carrierService = 1; - if (!$util.isString(message.carrierService)) - return "carrierService: string expected"; - } - if (message.warehouse != null && message.hasOwnProperty("warehouse")) { - properties._warehouse = 1; - if (!$util.isString(message.warehouse)) - return "warehouse: string expected"; - } - return null; - }; - - /** - * Creates a WarehouseBasedDeliveryTime message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime} WarehouseBasedDeliveryTime - */ - WarehouseBasedDeliveryTime.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime(); - if (object.carrier != null) - message.carrier = String(object.carrier); - if (object.carrierService != null) - message.carrierService = String(object.carrierService); - if (object.warehouse != null) - message.warehouse = String(object.warehouse); - return message; - }; - - /** - * Creates a plain object from a WarehouseBasedDeliveryTime message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @static - * @param {google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime} message WarehouseBasedDeliveryTime - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WarehouseBasedDeliveryTime.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.carrier != null && message.hasOwnProperty("carrier")) { - object.carrier = message.carrier; - if (options.oneofs) - object._carrier = "carrier"; - } - if (message.carrierService != null && message.hasOwnProperty("carrierService")) { - object.carrierService = message.carrierService; - if (options.oneofs) - object._carrierService = "carrierService"; - } - if (message.warehouse != null && message.hasOwnProperty("warehouse")) { - object.warehouse = message.warehouse; - if (options.oneofs) - object._warehouse = "warehouse"; - } - return object; - }; - - /** - * Converts this WarehouseBasedDeliveryTime to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @instance - * @returns {Object.} JSON object - */ - WarehouseBasedDeliveryTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WarehouseBasedDeliveryTime - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WarehouseBasedDeliveryTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.WarehouseBasedDeliveryTime"; - }; - - return WarehouseBasedDeliveryTime; - })(); - - v1beta.RateGroup = (function() { - - /** - * Properties of a RateGroup. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IRateGroup - * @property {Array.|null} [applicableShippingLabels] RateGroup applicableShippingLabels - * @property {google.shopping.merchant.accounts.v1beta.IValue|null} [singleValue] RateGroup singleValue - * @property {google.shopping.merchant.accounts.v1beta.ITable|null} [mainTable] RateGroup mainTable - * @property {Array.|null} [subtables] RateGroup subtables - * @property {Array.|null} [carrierRates] RateGroup carrierRates - * @property {string|null} [name] RateGroup name - */ - - /** - * Constructs a new RateGroup. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a RateGroup. - * @implements IRateGroup - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IRateGroup=} [properties] Properties to set - */ - function RateGroup(properties) { - this.applicableShippingLabels = []; - this.subtables = []; - this.carrierRates = []; - 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]]; - } - - /** - * RateGroup applicableShippingLabels. - * @member {Array.} applicableShippingLabels - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - */ - RateGroup.prototype.applicableShippingLabels = $util.emptyArray; - - /** - * RateGroup singleValue. - * @member {google.shopping.merchant.accounts.v1beta.IValue|null|undefined} singleValue - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - */ - RateGroup.prototype.singleValue = null; - - /** - * RateGroup mainTable. - * @member {google.shopping.merchant.accounts.v1beta.ITable|null|undefined} mainTable - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - */ - RateGroup.prototype.mainTable = null; - - /** - * RateGroup subtables. - * @member {Array.} subtables - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - */ - RateGroup.prototype.subtables = $util.emptyArray; - - /** - * RateGroup carrierRates. - * @member {Array.} carrierRates - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - */ - RateGroup.prototype.carrierRates = $util.emptyArray; - - /** - * RateGroup name. - * @member {string|null|undefined} name - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - */ - RateGroup.prototype.name = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RateGroup _singleValue. - * @member {"singleValue"|undefined} _singleValue - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - */ - Object.defineProperty(RateGroup.prototype, "_singleValue", { - get: $util.oneOfGetter($oneOfFields = ["singleValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * RateGroup _mainTable. - * @member {"mainTable"|undefined} _mainTable - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - */ - Object.defineProperty(RateGroup.prototype, "_mainTable", { - get: $util.oneOfGetter($oneOfFields = ["mainTable"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * RateGroup _name. - * @member {"name"|undefined} _name - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - */ - Object.defineProperty(RateGroup.prototype, "_name", { - get: $util.oneOfGetter($oneOfFields = ["name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RateGroup instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRateGroup=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.RateGroup} RateGroup instance - */ - RateGroup.create = function create(properties) { - return new RateGroup(properties); - }; - - /** - * Encodes the specified RateGroup message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RateGroup.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRateGroup} message RateGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RateGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.applicableShippingLabels != null && message.applicableShippingLabels.length) - for (var i = 0; i < message.applicableShippingLabels.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.applicableShippingLabels[i]); - if (message.singleValue != null && Object.hasOwnProperty.call(message, "singleValue")) - $root.google.shopping.merchant.accounts.v1beta.Value.encode(message.singleValue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.mainTable != null && Object.hasOwnProperty.call(message, "mainTable")) - $root.google.shopping.merchant.accounts.v1beta.Table.encode(message.mainTable, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.subtables != null && message.subtables.length) - for (var i = 0; i < message.subtables.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Table.encode(message.subtables[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.carrierRates != null && message.carrierRates.length) - for (var i = 0; i < message.carrierRates.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.CarrierRate.encode(message.carrierRates[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); - return writer; - }; - - /** - * Encodes the specified RateGroup message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RateGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRateGroup} message RateGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RateGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RateGroup message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @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.RateGroup} RateGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RateGroup.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.RateGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.applicableShippingLabels && message.applicableShippingLabels.length)) - message.applicableShippingLabels = []; - message.applicableShippingLabels.push(reader.string()); - break; - } - case 2: { - message.singleValue = $root.google.shopping.merchant.accounts.v1beta.Value.decode(reader, reader.uint32()); - break; - } - case 3: { - message.mainTable = $root.google.shopping.merchant.accounts.v1beta.Table.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.subtables && message.subtables.length)) - message.subtables = []; - message.subtables.push($root.google.shopping.merchant.accounts.v1beta.Table.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.carrierRates && message.carrierRates.length)) - message.carrierRates = []; - message.carrierRates.push($root.google.shopping.merchant.accounts.v1beta.CarrierRate.decode(reader, reader.uint32())); - break; - } - case 6: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RateGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.RateGroup} RateGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RateGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RateGroup message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RateGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.applicableShippingLabels != null && message.hasOwnProperty("applicableShippingLabels")) { - if (!Array.isArray(message.applicableShippingLabels)) - return "applicableShippingLabels: array expected"; - for (var i = 0; i < message.applicableShippingLabels.length; ++i) - if (!$util.isString(message.applicableShippingLabels[i])) - return "applicableShippingLabels: string[] expected"; - } - if (message.singleValue != null && message.hasOwnProperty("singleValue")) { - properties._singleValue = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Value.verify(message.singleValue); - if (error) - return "singleValue." + error; - } - } - if (message.mainTable != null && message.hasOwnProperty("mainTable")) { - properties._mainTable = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Table.verify(message.mainTable); - if (error) - return "mainTable." + error; - } - } - if (message.subtables != null && message.hasOwnProperty("subtables")) { - if (!Array.isArray(message.subtables)) - return "subtables: array expected"; - for (var i = 0; i < message.subtables.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Table.verify(message.subtables[i]); - if (error) - return "subtables." + error; - } - } - if (message.carrierRates != null && message.hasOwnProperty("carrierRates")) { - if (!Array.isArray(message.carrierRates)) - return "carrierRates: array expected"; - for (var i = 0; i < message.carrierRates.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.CarrierRate.verify(message.carrierRates[i]); - if (error) - return "carrierRates." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) { - properties._name = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - return null; - }; - - /** - * Creates a RateGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.RateGroup} RateGroup - */ - RateGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.RateGroup) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.RateGroup(); - if (object.applicableShippingLabels) { - if (!Array.isArray(object.applicableShippingLabels)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.applicableShippingLabels: array expected"); - message.applicableShippingLabels = []; - for (var i = 0; i < object.applicableShippingLabels.length; ++i) - message.applicableShippingLabels[i] = String(object.applicableShippingLabels[i]); - } - if (object.singleValue != null) { - if (typeof object.singleValue !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.singleValue: object expected"); - message.singleValue = $root.google.shopping.merchant.accounts.v1beta.Value.fromObject(object.singleValue); - } - if (object.mainTable != null) { - if (typeof object.mainTable !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.mainTable: object expected"); - message.mainTable = $root.google.shopping.merchant.accounts.v1beta.Table.fromObject(object.mainTable); - } - if (object.subtables) { - if (!Array.isArray(object.subtables)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.subtables: array expected"); - message.subtables = []; - for (var i = 0; i < object.subtables.length; ++i) { - if (typeof object.subtables[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.subtables: object expected"); - message.subtables[i] = $root.google.shopping.merchant.accounts.v1beta.Table.fromObject(object.subtables[i]); - } - } - if (object.carrierRates) { - if (!Array.isArray(object.carrierRates)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.carrierRates: array expected"); - message.carrierRates = []; - for (var i = 0; i < object.carrierRates.length; ++i) { - if (typeof object.carrierRates[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.RateGroup.carrierRates: object expected"); - message.carrierRates[i] = $root.google.shopping.merchant.accounts.v1beta.CarrierRate.fromObject(object.carrierRates[i]); - } - } - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a RateGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @static - * @param {google.shopping.merchant.accounts.v1beta.RateGroup} message RateGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RateGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.applicableShippingLabels = []; - object.subtables = []; - object.carrierRates = []; - } - if (message.applicableShippingLabels && message.applicableShippingLabels.length) { - object.applicableShippingLabels = []; - for (var j = 0; j < message.applicableShippingLabels.length; ++j) - object.applicableShippingLabels[j] = message.applicableShippingLabels[j]; - } - if (message.singleValue != null && message.hasOwnProperty("singleValue")) { - object.singleValue = $root.google.shopping.merchant.accounts.v1beta.Value.toObject(message.singleValue, options); - if (options.oneofs) - object._singleValue = "singleValue"; - } - if (message.mainTable != null && message.hasOwnProperty("mainTable")) { - object.mainTable = $root.google.shopping.merchant.accounts.v1beta.Table.toObject(message.mainTable, options); - if (options.oneofs) - object._mainTable = "mainTable"; - } - if (message.subtables && message.subtables.length) { - object.subtables = []; - for (var j = 0; j < message.subtables.length; ++j) - object.subtables[j] = $root.google.shopping.merchant.accounts.v1beta.Table.toObject(message.subtables[j], options); - } - if (message.carrierRates && message.carrierRates.length) { - object.carrierRates = []; - for (var j = 0; j < message.carrierRates.length; ++j) - object.carrierRates[j] = $root.google.shopping.merchant.accounts.v1beta.CarrierRate.toObject(message.carrierRates[j], options); - } - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object._name = "name"; - } - return object; - }; - - /** - * Converts this RateGroup to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @instance - * @returns {Object.} JSON object - */ - RateGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RateGroup - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.RateGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RateGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.RateGroup"; - }; - - return RateGroup; - })(); - - v1beta.Table = (function() { - - /** - * Properties of a Table. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ITable - * @property {string|null} [name] Table name - * @property {google.shopping.merchant.accounts.v1beta.IHeaders|null} [rowHeaders] Table rowHeaders - * @property {google.shopping.merchant.accounts.v1beta.IHeaders|null} [columnHeaders] Table columnHeaders - * @property {Array.|null} [rows] Table rows - */ - - /** - * Constructs a new Table. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Table. - * @implements ITable - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ITable=} [properties] Properties to set - */ - function Table(properties) { - this.rows = []; - 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]]; - } - - /** - * Table name. - * @member {string|null|undefined} name - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @instance - */ - Table.prototype.name = null; - - /** - * Table rowHeaders. - * @member {google.shopping.merchant.accounts.v1beta.IHeaders|null|undefined} rowHeaders - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @instance - */ - Table.prototype.rowHeaders = null; - - /** - * Table columnHeaders. - * @member {google.shopping.merchant.accounts.v1beta.IHeaders|null|undefined} columnHeaders - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @instance - */ - Table.prototype.columnHeaders = null; - - /** - * Table rows. - * @member {Array.} rows - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @instance - */ - Table.prototype.rows = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Table _name. - * @member {"name"|undefined} _name - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @instance - */ - Object.defineProperty(Table.prototype, "_name", { - get: $util.oneOfGetter($oneOfFields = ["name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Table _rowHeaders. - * @member {"rowHeaders"|undefined} _rowHeaders - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @instance - */ - Object.defineProperty(Table.prototype, "_rowHeaders", { - get: $util.oneOfGetter($oneOfFields = ["rowHeaders"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Table _columnHeaders. - * @member {"columnHeaders"|undefined} _columnHeaders - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @instance - */ - Object.defineProperty(Table.prototype, "_columnHeaders", { - get: $util.oneOfGetter($oneOfFields = ["columnHeaders"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Table instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITable=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Table} Table instance - */ - Table.create = function create(properties) { - return new Table(properties); - }; - - /** - * Encodes the specified Table message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Table.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITable} message Table message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Table.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.rowHeaders != null && Object.hasOwnProperty.call(message, "rowHeaders")) - $root.google.shopping.merchant.accounts.v1beta.Headers.encode(message.rowHeaders, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.columnHeaders != null && Object.hasOwnProperty.call(message, "columnHeaders")) - $root.google.shopping.merchant.accounts.v1beta.Headers.encode(message.columnHeaders, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Row.encode(message.rows[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Table message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Table.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITable} message Table message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Table.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Table message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @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.Table} Table - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Table.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.Table(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.rowHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.decode(reader, reader.uint32()); - break; - } - case 3: { - message.columnHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.shopping.merchant.accounts.v1beta.Row.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Table message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Table} Table - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Table.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Table message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Table.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) { - properties._name = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - if (message.rowHeaders != null && message.hasOwnProperty("rowHeaders")) { - properties._rowHeaders = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Headers.verify(message.rowHeaders); - if (error) - return "rowHeaders." + error; - } - } - if (message.columnHeaders != null && message.hasOwnProperty("columnHeaders")) { - properties._columnHeaders = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Headers.verify(message.columnHeaders); - if (error) - return "columnHeaders." + error; - } - } - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Row.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } - return null; - }; - - /** - * Creates a Table message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Table} Table - */ - Table.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Table) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Table(); - if (object.name != null) - message.name = String(object.name); - if (object.rowHeaders != null) { - if (typeof object.rowHeaders !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Table.rowHeaders: object expected"); - message.rowHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.fromObject(object.rowHeaders); - } - if (object.columnHeaders != null) { - if (typeof object.columnHeaders !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Table.columnHeaders: object expected"); - message.columnHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.fromObject(object.columnHeaders); - } - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Table.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Table.rows: object expected"); - message.rows[i] = $root.google.shopping.merchant.accounts.v1beta.Row.fromObject(object.rows[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Table message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @static - * @param {google.shopping.merchant.accounts.v1beta.Table} message Table - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Table.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rows = []; - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object._name = "name"; - } - if (message.rowHeaders != null && message.hasOwnProperty("rowHeaders")) { - object.rowHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.toObject(message.rowHeaders, options); - if (options.oneofs) - object._rowHeaders = "rowHeaders"; - } - if (message.columnHeaders != null && message.hasOwnProperty("columnHeaders")) { - object.columnHeaders = $root.google.shopping.merchant.accounts.v1beta.Headers.toObject(message.columnHeaders, options); - if (options.oneofs) - object._columnHeaders = "columnHeaders"; - } - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.shopping.merchant.accounts.v1beta.Row.toObject(message.rows[j], options); - } - return object; - }; - - /** - * Converts this Table to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @instance - * @returns {Object.} JSON object - */ - Table.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Table - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Table - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Table.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Table"; - }; - - return Table; - })(); - - v1beta.TransitTable = (function() { - - /** - * Properties of a TransitTable. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ITransitTable - * @property {Array.|null} [postalCodeGroupNames] TransitTable postalCodeGroupNames - * @property {Array.|null} [transitTimeLabels] TransitTable transitTimeLabels - * @property {Array.|null} [rows] TransitTable rows - */ - - /** - * Constructs a new TransitTable. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a TransitTable. - * @implements ITransitTable - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ITransitTable=} [properties] Properties to set - */ - function TransitTable(properties) { - this.postalCodeGroupNames = []; - this.transitTimeLabels = []; - this.rows = []; - 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]]; - } - - /** - * TransitTable postalCodeGroupNames. - * @member {Array.} postalCodeGroupNames - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @instance - */ - TransitTable.prototype.postalCodeGroupNames = $util.emptyArray; - - /** - * TransitTable transitTimeLabels. - * @member {Array.} transitTimeLabels - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @instance - */ - TransitTable.prototype.transitTimeLabels = $util.emptyArray; - - /** - * TransitTable rows. - * @member {Array.} rows - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @instance - */ - TransitTable.prototype.rows = $util.emptyArray; - - /** - * Creates a new TransitTable instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITransitTable=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.TransitTable} TransitTable instance - */ - TransitTable.create = function create(properties) { - return new TransitTable(properties); - }; - - /** - * Encodes the specified TransitTable message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITransitTable} message TransitTable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitTable.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.postalCodeGroupNames != null && message.postalCodeGroupNames.length) - for (var i = 0; i < message.postalCodeGroupNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.postalCodeGroupNames[i]); - if (message.transitTimeLabels != null && message.transitTimeLabels.length) - for (var i = 0; i < message.transitTimeLabels.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.transitTimeLabels[i]); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.encode(message.rows[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransitTable message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITransitTable} message TransitTable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitTable.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitTable message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @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.TransitTable} TransitTable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitTable.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.TransitTable(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.postalCodeGroupNames && message.postalCodeGroupNames.length)) - message.postalCodeGroupNames = []; - message.postalCodeGroupNames.push(reader.string()); - break; - } - case 2: { - if (!(message.transitTimeLabels && message.transitTimeLabels.length)) - message.transitTimeLabels = []; - message.transitTimeLabels.push(reader.string()); - break; - } - case 3: { - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitTable message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.TransitTable} TransitTable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitTable.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitTable message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitTable.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.postalCodeGroupNames != null && message.hasOwnProperty("postalCodeGroupNames")) { - if (!Array.isArray(message.postalCodeGroupNames)) - return "postalCodeGroupNames: array expected"; - for (var i = 0; i < message.postalCodeGroupNames.length; ++i) - if (!$util.isString(message.postalCodeGroupNames[i])) - return "postalCodeGroupNames: string[] expected"; - } - if (message.transitTimeLabels != null && message.hasOwnProperty("transitTimeLabels")) { - if (!Array.isArray(message.transitTimeLabels)) - return "transitTimeLabels: array expected"; - for (var i = 0; i < message.transitTimeLabels.length; ++i) - if (!$util.isString(message.transitTimeLabels[i])) - return "transitTimeLabels: string[] expected"; - } - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } - return null; - }; - - /** - * Creates a TransitTable message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.TransitTable} TransitTable - */ - TransitTable.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TransitTable) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.TransitTable(); - if (object.postalCodeGroupNames) { - if (!Array.isArray(object.postalCodeGroupNames)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.postalCodeGroupNames: array expected"); - message.postalCodeGroupNames = []; - for (var i = 0; i < object.postalCodeGroupNames.length; ++i) - message.postalCodeGroupNames[i] = String(object.postalCodeGroupNames[i]); - } - if (object.transitTimeLabels) { - if (!Array.isArray(object.transitTimeLabels)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.transitTimeLabels: array expected"); - message.transitTimeLabels = []; - for (var i = 0; i < object.transitTimeLabels.length; ++i) - message.transitTimeLabels[i] = String(object.transitTimeLabels[i]); - } - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.rows: object expected"); - message.rows[i] = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.fromObject(object.rows[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TransitTable message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @static - * @param {google.shopping.merchant.accounts.v1beta.TransitTable} message TransitTable - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitTable.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.postalCodeGroupNames = []; - object.transitTimeLabels = []; - object.rows = []; - } - if (message.postalCodeGroupNames && message.postalCodeGroupNames.length) { - object.postalCodeGroupNames = []; - for (var j = 0; j < message.postalCodeGroupNames.length; ++j) - object.postalCodeGroupNames[j] = message.postalCodeGroupNames[j]; - } - if (message.transitTimeLabels && message.transitTimeLabels.length) { - object.transitTimeLabels = []; - for (var j = 0; j < message.transitTimeLabels.length; ++j) - object.transitTimeLabels[j] = message.transitTimeLabels[j]; - } - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.toObject(message.rows[j], options); - } - return object; - }; - - /** - * Converts this TransitTable to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @instance - * @returns {Object.} JSON object - */ - TransitTable.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitTable - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitTable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TransitTable"; - }; - - TransitTable.TransitTimeRow = (function() { - - /** - * Properties of a TransitTimeRow. - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @interface ITransitTimeRow - * @property {Array.|null} [values] TransitTimeRow values - */ - - /** - * Constructs a new TransitTimeRow. - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable - * @classdesc Represents a TransitTimeRow. - * @implements ITransitTimeRow - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow=} [properties] Properties to set - */ - function TransitTimeRow(properties) { - this.values = []; - 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]]; - } - - /** - * TransitTimeRow values. - * @member {Array.} values - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @instance - */ - TransitTimeRow.prototype.values = $util.emptyArray; - - /** - * Creates a new TransitTimeRow instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @static - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow} TransitTimeRow instance - */ - TransitTimeRow.create = function create(properties) { - return new TransitTimeRow(properties); - }; - - /** - * Encodes the specified TransitTimeRow message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @static - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow} message TransitTimeRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitTimeRow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransitTimeRow message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @static - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.ITransitTimeRow} message TransitTimeRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitTimeRow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitTimeRow message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @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.TransitTable.TransitTimeRow} TransitTimeRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitTimeRow.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.TransitTable.TransitTimeRow(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitTimeRow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow} TransitTimeRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitTimeRow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitTimeRow message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitTimeRow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify(message.values[i]); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a TransitTimeRow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow} TransitTimeRow - */ - TransitTimeRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.values: object expected"); - message.values[i] = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.fromObject(object.values[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a TransitTimeRow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @static - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow} message TransitTimeRow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitTimeRow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this TransitTimeRow to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @instance - * @returns {Object.} JSON object - */ - TransitTimeRow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitTimeRow - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitTimeRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow"; - }; - - TransitTimeRow.TransitTimeValue = (function() { - - /** - * Properties of a TransitTimeValue. - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @interface ITransitTimeValue - * @property {number|null} [minTransitDays] TransitTimeValue minTransitDays - * @property {number|null} [maxTransitDays] TransitTimeValue maxTransitDays - */ - - /** - * Constructs a new TransitTimeValue. - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow - * @classdesc Represents a TransitTimeValue. - * @implements ITransitTimeValue - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue=} [properties] Properties to set - */ - function TransitTimeValue(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]]; - } - - /** - * TransitTimeValue minTransitDays. - * @member {number|null|undefined} minTransitDays - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @instance - */ - TransitTimeValue.prototype.minTransitDays = null; - - /** - * TransitTimeValue maxTransitDays. - * @member {number|null|undefined} maxTransitDays - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @instance - */ - TransitTimeValue.prototype.maxTransitDays = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransitTimeValue _minTransitDays. - * @member {"minTransitDays"|undefined} _minTransitDays - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @instance - */ - Object.defineProperty(TransitTimeValue.prototype, "_minTransitDays", { - get: $util.oneOfGetter($oneOfFields = ["minTransitDays"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * TransitTimeValue _maxTransitDays. - * @member {"maxTransitDays"|undefined} _maxTransitDays - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @instance - */ - Object.defineProperty(TransitTimeValue.prototype, "_maxTransitDays", { - get: $util.oneOfGetter($oneOfFields = ["maxTransitDays"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransitTimeValue instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @static - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue} TransitTimeValue instance - */ - TransitTimeValue.create = function create(properties) { - return new TransitTimeValue(properties); - }; - - /** - * Encodes the specified TransitTimeValue message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @static - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue} message TransitTimeValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitTimeValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minTransitDays != null && Object.hasOwnProperty.call(message, "minTransitDays")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minTransitDays); - if (message.maxTransitDays != null && Object.hasOwnProperty.call(message, "maxTransitDays")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxTransitDays); - return writer; - }; - - /** - * Encodes the specified TransitTimeValue message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @static - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.ITransitTimeValue} message TransitTimeValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TransitTimeValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TransitTimeValue message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @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.TransitTable.TransitTimeRow.TransitTimeValue} TransitTimeValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitTimeValue.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.TransitTable.TransitTimeRow.TransitTimeValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.minTransitDays = reader.int32(); - break; - } - case 2: { - message.maxTransitDays = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TransitTimeValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue} TransitTimeValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TransitTimeValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TransitTimeValue message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TransitTimeValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.minTransitDays != null && message.hasOwnProperty("minTransitDays")) { - properties._minTransitDays = 1; - if (!$util.isInteger(message.minTransitDays)) - return "minTransitDays: integer expected"; - } - if (message.maxTransitDays != null && message.hasOwnProperty("maxTransitDays")) { - properties._maxTransitDays = 1; - if (!$util.isInteger(message.maxTransitDays)) - return "maxTransitDays: integer expected"; - } - return null; - }; - - /** - * Creates a TransitTimeValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue} TransitTimeValue - */ - TransitTimeValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue(); - if (object.minTransitDays != null) - message.minTransitDays = object.minTransitDays | 0; - if (object.maxTransitDays != null) - message.maxTransitDays = object.maxTransitDays | 0; - return message; - }; - - /** - * Creates a plain object from a TransitTimeValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @static - * @param {google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue} message TransitTimeValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TransitTimeValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.minTransitDays != null && message.hasOwnProperty("minTransitDays")) { - object.minTransitDays = message.minTransitDays; - if (options.oneofs) - object._minTransitDays = "minTransitDays"; - } - if (message.maxTransitDays != null && message.hasOwnProperty("maxTransitDays")) { - object.maxTransitDays = message.maxTransitDays; - if (options.oneofs) - object._maxTransitDays = "maxTransitDays"; - } - return object; - }; - - /** - * Converts this TransitTimeValue to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @instance - * @returns {Object.} JSON object - */ - TransitTimeValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TransitTimeValue - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TransitTimeValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TransitTable.TransitTimeRow.TransitTimeValue"; - }; - - return TransitTimeValue; - })(); - - return TransitTimeRow; - })(); - - return TransitTable; - })(); - - v1beta.MinimumOrderValueTable = (function() { - - /** - * Properties of a MinimumOrderValueTable. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IMinimumOrderValueTable - * @property {Array.|null} [storeCodeSetWithMovs] MinimumOrderValueTable storeCodeSetWithMovs - */ - - /** - * Constructs a new MinimumOrderValueTable. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a MinimumOrderValueTable. - * @implements IMinimumOrderValueTable - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable=} [properties] Properties to set - */ - function MinimumOrderValueTable(properties) { - this.storeCodeSetWithMovs = []; - 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]]; - } - - /** - * MinimumOrderValueTable storeCodeSetWithMovs. - * @member {Array.} storeCodeSetWithMovs - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @instance - */ - MinimumOrderValueTable.prototype.storeCodeSetWithMovs = $util.emptyArray; - - /** - * Creates a new MinimumOrderValueTable instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @static - * @param {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable} MinimumOrderValueTable instance - */ - MinimumOrderValueTable.create = function create(properties) { - return new MinimumOrderValueTable(properties); - }; - - /** - * Encodes the specified MinimumOrderValueTable message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @static - * @param {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable} message MinimumOrderValueTable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MinimumOrderValueTable.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.storeCodeSetWithMovs != null && message.storeCodeSetWithMovs.length) - for (var i = 0; i < message.storeCodeSetWithMovs.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.encode(message.storeCodeSetWithMovs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MinimumOrderValueTable message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @static - * @param {google.shopping.merchant.accounts.v1beta.IMinimumOrderValueTable} message MinimumOrderValueTable message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MinimumOrderValueTable.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MinimumOrderValueTable message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @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.MinimumOrderValueTable} MinimumOrderValueTable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MinimumOrderValueTable.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.MinimumOrderValueTable(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.storeCodeSetWithMovs && message.storeCodeSetWithMovs.length)) - message.storeCodeSetWithMovs = []; - message.storeCodeSetWithMovs.push($root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MinimumOrderValueTable message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable} MinimumOrderValueTable - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MinimumOrderValueTable.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MinimumOrderValueTable message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MinimumOrderValueTable.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.storeCodeSetWithMovs != null && message.hasOwnProperty("storeCodeSetWithMovs")) { - if (!Array.isArray(message.storeCodeSetWithMovs)) - return "storeCodeSetWithMovs: array expected"; - for (var i = 0; i < message.storeCodeSetWithMovs.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify(message.storeCodeSetWithMovs[i]); - if (error) - return "storeCodeSetWithMovs." + error; - } - } - return null; - }; - - /** - * Creates a MinimumOrderValueTable message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable} MinimumOrderValueTable - */ - MinimumOrderValueTable.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable(); - if (object.storeCodeSetWithMovs) { - if (!Array.isArray(object.storeCodeSetWithMovs)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.storeCodeSetWithMovs: array expected"); - message.storeCodeSetWithMovs = []; - for (var i = 0; i < object.storeCodeSetWithMovs.length; ++i) { - if (typeof object.storeCodeSetWithMovs[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.storeCodeSetWithMovs: object expected"); - message.storeCodeSetWithMovs[i] = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.fromObject(object.storeCodeSetWithMovs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MinimumOrderValueTable message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @static - * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable} message MinimumOrderValueTable - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MinimumOrderValueTable.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.storeCodeSetWithMovs = []; - if (message.storeCodeSetWithMovs && message.storeCodeSetWithMovs.length) { - object.storeCodeSetWithMovs = []; - for (var j = 0; j < message.storeCodeSetWithMovs.length; ++j) - object.storeCodeSetWithMovs[j] = $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.toObject(message.storeCodeSetWithMovs[j], options); - } - return object; - }; - - /** - * Converts this MinimumOrderValueTable to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @instance - * @returns {Object.} JSON object - */ - MinimumOrderValueTable.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MinimumOrderValueTable - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MinimumOrderValueTable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable"; - }; - - MinimumOrderValueTable.StoreCodeSetWithMov = (function() { - - /** - * Properties of a StoreCodeSetWithMov. - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @interface IStoreCodeSetWithMov - * @property {Array.|null} [storeCodes] StoreCodeSetWithMov storeCodes - * @property {google.shopping.type.IPrice|null} [value] StoreCodeSetWithMov value - */ - - /** - * Constructs a new StoreCodeSetWithMov. - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable - * @classdesc Represents a StoreCodeSetWithMov. - * @implements IStoreCodeSetWithMov - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov=} [properties] Properties to set - */ - function StoreCodeSetWithMov(properties) { - this.storeCodes = []; - 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]]; - } - - /** - * StoreCodeSetWithMov storeCodes. - * @member {Array.} storeCodes - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @instance - */ - StoreCodeSetWithMov.prototype.storeCodes = $util.emptyArray; - - /** - * StoreCodeSetWithMov value. - * @member {google.shopping.type.IPrice|null|undefined} value - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @instance - */ - StoreCodeSetWithMov.prototype.value = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * StoreCodeSetWithMov _value. - * @member {"value"|undefined} _value - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @instance - */ - Object.defineProperty(StoreCodeSetWithMov.prototype, "_value", { - get: $util.oneOfGetter($oneOfFields = ["value"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new StoreCodeSetWithMov instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @static - * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov} StoreCodeSetWithMov instance - */ - StoreCodeSetWithMov.create = function create(properties) { - return new StoreCodeSetWithMov(properties); - }; - - /** - * Encodes the specified StoreCodeSetWithMov message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @static - * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov} message StoreCodeSetWithMov message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StoreCodeSetWithMov.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.storeCodes != null && message.storeCodes.length) - for (var i = 0; i < message.storeCodes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.storeCodes[i]); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.shopping.type.Price.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StoreCodeSetWithMov message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @static - * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.IStoreCodeSetWithMov} message StoreCodeSetWithMov message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StoreCodeSetWithMov.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StoreCodeSetWithMov message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @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.MinimumOrderValueTable.StoreCodeSetWithMov} StoreCodeSetWithMov - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StoreCodeSetWithMov.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.MinimumOrderValueTable.StoreCodeSetWithMov(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.storeCodes && message.storeCodes.length)) - message.storeCodes = []; - message.storeCodes.push(reader.string()); - break; - } - case 2: { - message.value = $root.google.shopping.type.Price.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StoreCodeSetWithMov message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov} StoreCodeSetWithMov - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StoreCodeSetWithMov.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StoreCodeSetWithMov message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StoreCodeSetWithMov.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.storeCodes != null && message.hasOwnProperty("storeCodes")) { - if (!Array.isArray(message.storeCodes)) - return "storeCodes: array expected"; - for (var i = 0; i < message.storeCodes.length; ++i) - if (!$util.isString(message.storeCodes[i])) - return "storeCodes: string[] expected"; - } - if (message.value != null && message.hasOwnProperty("value")) { - properties._value = 1; - { - var error = $root.google.shopping.type.Price.verify(message.value); - if (error) - return "value." + error; - } - } - return null; - }; - - /** - * Creates a StoreCodeSetWithMov message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov} StoreCodeSetWithMov - */ - StoreCodeSetWithMov.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov(); - if (object.storeCodes) { - if (!Array.isArray(object.storeCodes)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.storeCodes: array expected"); - message.storeCodes = []; - for (var i = 0; i < object.storeCodes.length; ++i) - message.storeCodes[i] = String(object.storeCodes[i]); - } - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov.value: object expected"); - message.value = $root.google.shopping.type.Price.fromObject(object.value); - } - return message; - }; - - /** - * Creates a plain object from a StoreCodeSetWithMov message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @static - * @param {google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov} message StoreCodeSetWithMov - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StoreCodeSetWithMov.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.storeCodes = []; - if (message.storeCodes && message.storeCodes.length) { - object.storeCodes = []; - for (var j = 0; j < message.storeCodes.length; ++j) - object.storeCodes[j] = message.storeCodes[j]; - } - if (message.value != null && message.hasOwnProperty("value")) { - object.value = $root.google.shopping.type.Price.toObject(message.value, options); - if (options.oneofs) - object._value = "value"; - } - return object; - }; - - /** - * Converts this StoreCodeSetWithMov to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @instance - * @returns {Object.} JSON object - */ - StoreCodeSetWithMov.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StoreCodeSetWithMov - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StoreCodeSetWithMov.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.MinimumOrderValueTable.StoreCodeSetWithMov"; - }; - - return StoreCodeSetWithMov; - })(); - - return MinimumOrderValueTable; - })(); - - v1beta.Headers = (function() { - - /** - * Properties of a Headers. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IHeaders - * @property {Array.|null} [prices] Headers prices - * @property {Array.|null} [weights] Headers weights - * @property {Array.|null} [numberOfItems] Headers numberOfItems - * @property {Array.|null} [postalCodeGroupNames] Headers postalCodeGroupNames - * @property {Array.|null} [locations] Headers locations - */ - - /** - * Constructs a new Headers. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Headers. - * @implements IHeaders - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IHeaders=} [properties] Properties to set - */ - function Headers(properties) { - this.prices = []; - this.weights = []; - this.numberOfItems = []; - this.postalCodeGroupNames = []; - this.locations = []; - 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]]; - } - - /** - * Headers prices. - * @member {Array.} prices - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @instance - */ - Headers.prototype.prices = $util.emptyArray; - - /** - * Headers weights. - * @member {Array.} weights - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @instance - */ - Headers.prototype.weights = $util.emptyArray; - - /** - * Headers numberOfItems. - * @member {Array.} numberOfItems - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @instance - */ - Headers.prototype.numberOfItems = $util.emptyArray; - - /** - * Headers postalCodeGroupNames. - * @member {Array.} postalCodeGroupNames - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @instance - */ - Headers.prototype.postalCodeGroupNames = $util.emptyArray; - - /** - * Headers locations. - * @member {Array.} locations - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @instance - */ - Headers.prototype.locations = $util.emptyArray; - - /** - * Creates a new Headers instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @static - * @param {google.shopping.merchant.accounts.v1beta.IHeaders=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Headers} Headers instance - */ - Headers.create = function create(properties) { - return new Headers(properties); - }; - - /** - * Encodes the specified Headers message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Headers.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @static - * @param {google.shopping.merchant.accounts.v1beta.IHeaders} message Headers message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Headers.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.prices != null && message.prices.length) - for (var i = 0; i < message.prices.length; ++i) - $root.google.shopping.type.Price.encode(message.prices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.weights != null && message.weights.length) - for (var i = 0; i < message.weights.length; ++i) - $root.google.shopping.type.Weight.encode(message.weights[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.numberOfItems != null && message.numberOfItems.length) - for (var i = 0; i < message.numberOfItems.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.numberOfItems[i]); - if (message.postalCodeGroupNames != null && message.postalCodeGroupNames.length) - for (var i = 0; i < message.postalCodeGroupNames.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCodeGroupNames[i]); - if (message.locations != null && message.locations.length) - for (var i = 0; i < message.locations.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.LocationIdSet.encode(message.locations[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Headers message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Headers.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @static - * @param {google.shopping.merchant.accounts.v1beta.IHeaders} message Headers message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Headers.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Headers message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @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.Headers} Headers - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Headers.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.Headers(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.prices && message.prices.length)) - message.prices = []; - message.prices.push($root.google.shopping.type.Price.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.weights && message.weights.length)) - message.weights = []; - message.weights.push($root.google.shopping.type.Weight.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.numberOfItems && message.numberOfItems.length)) - message.numberOfItems = []; - message.numberOfItems.push(reader.string()); - break; - } - case 4: { - if (!(message.postalCodeGroupNames && message.postalCodeGroupNames.length)) - message.postalCodeGroupNames = []; - message.postalCodeGroupNames.push(reader.string()); - break; - } - case 5: { - if (!(message.locations && message.locations.length)) - message.locations = []; - message.locations.push($root.google.shopping.merchant.accounts.v1beta.LocationIdSet.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Headers message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Headers} Headers - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Headers.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Headers message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Headers.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.prices != null && message.hasOwnProperty("prices")) { - if (!Array.isArray(message.prices)) - return "prices: array expected"; - for (var i = 0; i < message.prices.length; ++i) { - var error = $root.google.shopping.type.Price.verify(message.prices[i]); - if (error) - return "prices." + error; - } - } - if (message.weights != null && message.hasOwnProperty("weights")) { - if (!Array.isArray(message.weights)) - return "weights: array expected"; - for (var i = 0; i < message.weights.length; ++i) { - var error = $root.google.shopping.type.Weight.verify(message.weights[i]); - if (error) - return "weights." + error; - } - } - if (message.numberOfItems != null && message.hasOwnProperty("numberOfItems")) { - if (!Array.isArray(message.numberOfItems)) - return "numberOfItems: array expected"; - for (var i = 0; i < message.numberOfItems.length; ++i) - if (!$util.isString(message.numberOfItems[i])) - return "numberOfItems: string[] expected"; - } - if (message.postalCodeGroupNames != null && message.hasOwnProperty("postalCodeGroupNames")) { - if (!Array.isArray(message.postalCodeGroupNames)) - return "postalCodeGroupNames: array expected"; - for (var i = 0; i < message.postalCodeGroupNames.length; ++i) - if (!$util.isString(message.postalCodeGroupNames[i])) - return "postalCodeGroupNames: string[] expected"; - } - if (message.locations != null && message.hasOwnProperty("locations")) { - if (!Array.isArray(message.locations)) - return "locations: array expected"; - for (var i = 0; i < message.locations.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.LocationIdSet.verify(message.locations[i]); - if (error) - return "locations." + error; - } - } - return null; - }; - - /** - * Creates a Headers message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Headers} Headers - */ - Headers.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Headers) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Headers(); - if (object.prices) { - if (!Array.isArray(object.prices)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.prices: array expected"); - message.prices = []; - for (var i = 0; i < object.prices.length; ++i) { - if (typeof object.prices[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.prices: object expected"); - message.prices[i] = $root.google.shopping.type.Price.fromObject(object.prices[i]); - } - } - if (object.weights) { - if (!Array.isArray(object.weights)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.weights: array expected"); - message.weights = []; - for (var i = 0; i < object.weights.length; ++i) { - if (typeof object.weights[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.weights: object expected"); - message.weights[i] = $root.google.shopping.type.Weight.fromObject(object.weights[i]); - } - } - if (object.numberOfItems) { - if (!Array.isArray(object.numberOfItems)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.numberOfItems: array expected"); - message.numberOfItems = []; - for (var i = 0; i < object.numberOfItems.length; ++i) - message.numberOfItems[i] = String(object.numberOfItems[i]); - } - if (object.postalCodeGroupNames) { - if (!Array.isArray(object.postalCodeGroupNames)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.postalCodeGroupNames: array expected"); - message.postalCodeGroupNames = []; - for (var i = 0; i < object.postalCodeGroupNames.length; ++i) - message.postalCodeGroupNames[i] = String(object.postalCodeGroupNames[i]); - } - if (object.locations) { - if (!Array.isArray(object.locations)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.locations: array expected"); - message.locations = []; - for (var i = 0; i < object.locations.length; ++i) { - if (typeof object.locations[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Headers.locations: object expected"); - message.locations[i] = $root.google.shopping.merchant.accounts.v1beta.LocationIdSet.fromObject(object.locations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Headers message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @static - * @param {google.shopping.merchant.accounts.v1beta.Headers} message Headers - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Headers.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.prices = []; - object.weights = []; - object.numberOfItems = []; - object.postalCodeGroupNames = []; - object.locations = []; - } - if (message.prices && message.prices.length) { - object.prices = []; - for (var j = 0; j < message.prices.length; ++j) - object.prices[j] = $root.google.shopping.type.Price.toObject(message.prices[j], options); - } - if (message.weights && message.weights.length) { - object.weights = []; - for (var j = 0; j < message.weights.length; ++j) - object.weights[j] = $root.google.shopping.type.Weight.toObject(message.weights[j], options); - } - if (message.numberOfItems && message.numberOfItems.length) { - object.numberOfItems = []; - for (var j = 0; j < message.numberOfItems.length; ++j) - object.numberOfItems[j] = message.numberOfItems[j]; - } - if (message.postalCodeGroupNames && message.postalCodeGroupNames.length) { - object.postalCodeGroupNames = []; - for (var j = 0; j < message.postalCodeGroupNames.length; ++j) - object.postalCodeGroupNames[j] = message.postalCodeGroupNames[j]; - } - if (message.locations && message.locations.length) { - object.locations = []; - for (var j = 0; j < message.locations.length; ++j) - object.locations[j] = $root.google.shopping.merchant.accounts.v1beta.LocationIdSet.toObject(message.locations[j], options); - } - return object; - }; - - /** - * Converts this Headers to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @instance - * @returns {Object.} JSON object - */ - Headers.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Headers - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Headers - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Headers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Headers"; - }; - - return Headers; - })(); - - v1beta.LocationIdSet = (function() { - - /** - * Properties of a LocationIdSet. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ILocationIdSet - * @property {Array.|null} [locationIds] LocationIdSet locationIds - */ - - /** - * Constructs a new LocationIdSet. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a LocationIdSet. - * @implements ILocationIdSet - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ILocationIdSet=} [properties] Properties to set - */ - function LocationIdSet(properties) { - this.locationIds = []; - 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]]; - } - - /** - * LocationIdSet locationIds. - * @member {Array.} locationIds - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @instance - */ - LocationIdSet.prototype.locationIds = $util.emptyArray; - - /** - * Creates a new LocationIdSet instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @static - * @param {google.shopping.merchant.accounts.v1beta.ILocationIdSet=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.LocationIdSet} LocationIdSet instance - */ - LocationIdSet.create = function create(properties) { - return new LocationIdSet(properties); - }; - - /** - * Encodes the specified LocationIdSet message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.LocationIdSet.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @static - * @param {google.shopping.merchant.accounts.v1beta.ILocationIdSet} message LocationIdSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationIdSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.locationIds != null && message.locationIds.length) - for (var i = 0; i < message.locationIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationIds[i]); - return writer; - }; - - /** - * Encodes the specified LocationIdSet message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.LocationIdSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @static - * @param {google.shopping.merchant.accounts.v1beta.ILocationIdSet} message LocationIdSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationIdSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocationIdSet message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @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.LocationIdSet} LocationIdSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationIdSet.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.LocationIdSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.locationIds && message.locationIds.length)) - message.locationIds = []; - message.locationIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocationIdSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.LocationIdSet} LocationIdSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationIdSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocationIdSet message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocationIdSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.locationIds != null && message.hasOwnProperty("locationIds")) { - if (!Array.isArray(message.locationIds)) - return "locationIds: array expected"; - for (var i = 0; i < message.locationIds.length; ++i) - if (!$util.isString(message.locationIds[i])) - return "locationIds: string[] expected"; - } - return null; - }; - - /** - * Creates a LocationIdSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.LocationIdSet} LocationIdSet - */ - LocationIdSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.LocationIdSet) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.LocationIdSet(); - if (object.locationIds) { - if (!Array.isArray(object.locationIds)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.LocationIdSet.locationIds: array expected"); - message.locationIds = []; - for (var i = 0; i < object.locationIds.length; ++i) - message.locationIds[i] = String(object.locationIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a LocationIdSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @static - * @param {google.shopping.merchant.accounts.v1beta.LocationIdSet} message LocationIdSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocationIdSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.locationIds = []; - if (message.locationIds && message.locationIds.length) { - object.locationIds = []; - for (var j = 0; j < message.locationIds.length; ++j) - object.locationIds[j] = message.locationIds[j]; - } - return object; - }; - - /** - * Converts this LocationIdSet to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @instance - * @returns {Object.} JSON object - */ - LocationIdSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocationIdSet - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.LocationIdSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocationIdSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.LocationIdSet"; - }; - - return LocationIdSet; - })(); - - v1beta.Row = (function() { - - /** - * Properties of a Row. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IRow - * @property {Array.|null} [cells] Row cells - */ - - /** - * Constructs a new Row. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Row. - * @implements IRow - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IRow=} [properties] Properties to set - */ - function Row(properties) { - this.cells = []; - 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]]; - } - - /** - * Row cells. - * @member {Array.} cells - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @instance - */ - Row.prototype.cells = $util.emptyArray; - - /** - * Creates a new Row instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRow=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Row} Row instance - */ - Row.create = function create(properties) { - return new Row(properties); - }; - - /** - * Encodes the specified Row message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Row.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRow} message Row message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Row.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cells != null && message.cells.length) - for (var i = 0; i < message.cells.length; ++i) - $root.google.shopping.merchant.accounts.v1beta.Value.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Row message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Row.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRow} message Row message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Row.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Row message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @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.Row} Row - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Row.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.Row(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.cells && message.cells.length)) - message.cells = []; - message.cells.push($root.google.shopping.merchant.accounts.v1beta.Value.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Row message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Row} Row - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Row.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Row message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Row.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cells != null && message.hasOwnProperty("cells")) { - if (!Array.isArray(message.cells)) - return "cells: array expected"; - for (var i = 0; i < message.cells.length; ++i) { - var error = $root.google.shopping.merchant.accounts.v1beta.Value.verify(message.cells[i]); - if (error) - return "cells." + error; - } - } - return null; - }; - - /** - * Creates a Row message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Row} Row - */ - Row.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Row) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Row(); - if (object.cells) { - if (!Array.isArray(object.cells)) - throw TypeError(".google.shopping.merchant.accounts.v1beta.Row.cells: array expected"); - message.cells = []; - for (var i = 0; i < object.cells.length; ++i) { - if (typeof object.cells[i] !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Row.cells: object expected"); - message.cells[i] = $root.google.shopping.merchant.accounts.v1beta.Value.fromObject(object.cells[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Row message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @static - * @param {google.shopping.merchant.accounts.v1beta.Row} message Row - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Row.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cells = []; - if (message.cells && message.cells.length) { - object.cells = []; - for (var j = 0; j < message.cells.length; ++j) - object.cells[j] = $root.google.shopping.merchant.accounts.v1beta.Value.toObject(message.cells[j], options); - } - return object; - }; - - /** - * Converts this Row to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @instance - * @returns {Object.} JSON object - */ - Row.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Row - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Row - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Row"; - }; - - return Row; - })(); - - v1beta.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IValue - * @property {boolean|null} [noShipping] Value noShipping - * @property {google.shopping.type.IPrice|null} [flatRate] Value flatRate - * @property {string|null} [pricePercentage] Value pricePercentage - * @property {string|null} [carrierRate] Value carrierRate - * @property {string|null} [subtable] Value subtable - */ - - /** - * Constructs a new Value. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IValue=} [properties] Properties to set - */ - function Value(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]]; - } - - /** - * Value noShipping. - * @member {boolean|null|undefined} noShipping - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Value.prototype.noShipping = null; - - /** - * Value flatRate. - * @member {google.shopping.type.IPrice|null|undefined} flatRate - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Value.prototype.flatRate = null; - - /** - * Value pricePercentage. - * @member {string|null|undefined} pricePercentage - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Value.prototype.pricePercentage = null; - - /** - * Value carrierRate. - * @member {string|null|undefined} carrierRate - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Value.prototype.carrierRate = null; - - /** - * Value subtable. - * @member {string|null|undefined} subtable - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Value.prototype.subtable = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value _noShipping. - * @member {"noShipping"|undefined} _noShipping - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Object.defineProperty(Value.prototype, "_noShipping", { - get: $util.oneOfGetter($oneOfFields = ["noShipping"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Value _flatRate. - * @member {"flatRate"|undefined} _flatRate - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Object.defineProperty(Value.prototype, "_flatRate", { - get: $util.oneOfGetter($oneOfFields = ["flatRate"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Value _pricePercentage. - * @member {"pricePercentage"|undefined} _pricePercentage - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Object.defineProperty(Value.prototype, "_pricePercentage", { - get: $util.oneOfGetter($oneOfFields = ["pricePercentage"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Value _carrierRate. - * @member {"carrierRate"|undefined} _carrierRate - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Object.defineProperty(Value.prototype, "_carrierRate", { - get: $util.oneOfGetter($oneOfFields = ["carrierRate"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Value _subtable. - * @member {"subtable"|undefined} _subtable - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - */ - Object.defineProperty(Value.prototype, "_subtable", { - get: $util.oneOfGetter($oneOfFields = ["subtable"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @static - * @param {google.shopping.merchant.accounts.v1beta.IValue=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Value.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @static - * @param {google.shopping.merchant.accounts.v1beta.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.noShipping != null && Object.hasOwnProperty.call(message, "noShipping")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.noShipping); - if (message.flatRate != null && Object.hasOwnProperty.call(message, "flatRate")) - $root.google.shopping.type.Price.encode(message.flatRate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.pricePercentage != null && Object.hasOwnProperty.call(message, "pricePercentage")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pricePercentage); - if (message.carrierRate != null && Object.hasOwnProperty.call(message, "carrierRate")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.carrierRate); - if (message.subtable != null && Object.hasOwnProperty.call(message, "subtable")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.subtable); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @static - * @param {google.shopping.merchant.accounts.v1beta.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @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.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.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.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.noShipping = reader.bool(); - break; - } - case 2: { - message.flatRate = $root.google.shopping.type.Price.decode(reader, reader.uint32()); - break; - } - case 3: { - message.pricePercentage = reader.string(); - break; - } - case 4: { - message.carrierRate = reader.string(); - break; - } - case 5: { - message.subtable = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.noShipping != null && message.hasOwnProperty("noShipping")) { - properties._noShipping = 1; - if (typeof message.noShipping !== "boolean") - return "noShipping: boolean expected"; - } - if (message.flatRate != null && message.hasOwnProperty("flatRate")) { - properties._flatRate = 1; - { - var error = $root.google.shopping.type.Price.verify(message.flatRate); - if (error) - return "flatRate." + error; - } - } - if (message.pricePercentage != null && message.hasOwnProperty("pricePercentage")) { - properties._pricePercentage = 1; - if (!$util.isString(message.pricePercentage)) - return "pricePercentage: string expected"; - } - if (message.carrierRate != null && message.hasOwnProperty("carrierRate")) { - properties._carrierRate = 1; - if (!$util.isString(message.carrierRate)) - return "carrierRate: string expected"; - } - if (message.subtable != null && message.hasOwnProperty("subtable")) { - properties._subtable = 1; - if (!$util.isString(message.subtable)) - return "subtable: string expected"; - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Value) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Value(); - if (object.noShipping != null) - message.noShipping = Boolean(object.noShipping); - if (object.flatRate != null) { - if (typeof object.flatRate !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Value.flatRate: object expected"); - message.flatRate = $root.google.shopping.type.Price.fromObject(object.flatRate); - } - if (object.pricePercentage != null) - message.pricePercentage = String(object.pricePercentage); - if (object.carrierRate != null) - message.carrierRate = String(object.carrierRate); - if (object.subtable != null) - message.subtable = String(object.subtable); - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @static - * @param {google.shopping.merchant.accounts.v1beta.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.noShipping != null && message.hasOwnProperty("noShipping")) { - object.noShipping = message.noShipping; - if (options.oneofs) - object._noShipping = "noShipping"; - } - if (message.flatRate != null && message.hasOwnProperty("flatRate")) { - object.flatRate = $root.google.shopping.type.Price.toObject(message.flatRate, options); - if (options.oneofs) - object._flatRate = "flatRate"; - } - if (message.pricePercentage != null && message.hasOwnProperty("pricePercentage")) { - object.pricePercentage = message.pricePercentage; - if (options.oneofs) - object._pricePercentage = "pricePercentage"; - } - if (message.carrierRate != null && message.hasOwnProperty("carrierRate")) { - object.carrierRate = message.carrierRate; - if (options.oneofs) - object._carrierRate = "carrierRate"; - } - if (message.subtable != null && message.hasOwnProperty("subtable")) { - object.subtable = message.subtable; - if (options.oneofs) - object._subtable = "subtable"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Value"; - }; - - return Value; - })(); - - v1beta.CarrierRate = (function() { - - /** - * Properties of a CarrierRate. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ICarrierRate - * @property {string|null} [name] CarrierRate name - * @property {string|null} [carrier] CarrierRate carrier - * @property {string|null} [carrierService] CarrierRate carrierService - * @property {string|null} [originPostalCode] CarrierRate originPostalCode - * @property {string|null} [percentageAdjustment] CarrierRate percentageAdjustment - * @property {google.shopping.type.IPrice|null} [flatAdjustment] CarrierRate flatAdjustment - */ - - /** - * Constructs a new CarrierRate. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a CarrierRate. - * @implements ICarrierRate - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ICarrierRate=} [properties] Properties to set - */ - function CarrierRate(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]]; - } - - /** - * CarrierRate name. - * @member {string|null|undefined} name - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - CarrierRate.prototype.name = null; - - /** - * CarrierRate carrier. - * @member {string|null|undefined} carrier - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - CarrierRate.prototype.carrier = null; - - /** - * CarrierRate carrierService. - * @member {string|null|undefined} carrierService - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - CarrierRate.prototype.carrierService = null; - - /** - * CarrierRate originPostalCode. - * @member {string|null|undefined} originPostalCode - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - CarrierRate.prototype.originPostalCode = null; - - /** - * CarrierRate percentageAdjustment. - * @member {string|null|undefined} percentageAdjustment - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - CarrierRate.prototype.percentageAdjustment = null; - - /** - * CarrierRate flatAdjustment. - * @member {google.shopping.type.IPrice|null|undefined} flatAdjustment - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - CarrierRate.prototype.flatAdjustment = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CarrierRate _name. - * @member {"name"|undefined} _name - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - Object.defineProperty(CarrierRate.prototype, "_name", { - get: $util.oneOfGetter($oneOfFields = ["name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CarrierRate _carrier. - * @member {"carrier"|undefined} _carrier - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - Object.defineProperty(CarrierRate.prototype, "_carrier", { - get: $util.oneOfGetter($oneOfFields = ["carrier"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CarrierRate _carrierService. - * @member {"carrierService"|undefined} _carrierService - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - Object.defineProperty(CarrierRate.prototype, "_carrierService", { - get: $util.oneOfGetter($oneOfFields = ["carrierService"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CarrierRate _originPostalCode. - * @member {"originPostalCode"|undefined} _originPostalCode - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - Object.defineProperty(CarrierRate.prototype, "_originPostalCode", { - get: $util.oneOfGetter($oneOfFields = ["originPostalCode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CarrierRate _percentageAdjustment. - * @member {"percentageAdjustment"|undefined} _percentageAdjustment - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - Object.defineProperty(CarrierRate.prototype, "_percentageAdjustment", { - get: $util.oneOfGetter($oneOfFields = ["percentageAdjustment"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CarrierRate _flatAdjustment. - * @member {"flatAdjustment"|undefined} _flatAdjustment - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - */ - Object.defineProperty(CarrierRate.prototype, "_flatAdjustment", { - get: $util.oneOfGetter($oneOfFields = ["flatAdjustment"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CarrierRate instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICarrierRate=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.CarrierRate} CarrierRate instance - */ - CarrierRate.create = function create(properties) { - return new CarrierRate(properties); - }; - - /** - * Encodes the specified CarrierRate message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CarrierRate.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICarrierRate} message CarrierRate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CarrierRate.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.carrier != null && Object.hasOwnProperty.call(message, "carrier")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.carrier); - if (message.carrierService != null && Object.hasOwnProperty.call(message, "carrierService")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.carrierService); - if (message.originPostalCode != null && Object.hasOwnProperty.call(message, "originPostalCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.originPostalCode); - if (message.percentageAdjustment != null && Object.hasOwnProperty.call(message, "percentageAdjustment")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.percentageAdjustment); - if (message.flatAdjustment != null && Object.hasOwnProperty.call(message, "flatAdjustment")) - $root.google.shopping.type.Price.encode(message.flatAdjustment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CarrierRate message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.CarrierRate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @static - * @param {google.shopping.merchant.accounts.v1beta.ICarrierRate} message CarrierRate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CarrierRate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CarrierRate message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @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.CarrierRate} CarrierRate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CarrierRate.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.CarrierRate(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.carrier = reader.string(); - break; - } - case 3: { - message.carrierService = reader.string(); - break; - } - case 4: { - message.originPostalCode = reader.string(); - break; - } - case 5: { - message.percentageAdjustment = reader.string(); - break; - } - case 6: { - message.flatAdjustment = $root.google.shopping.type.Price.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CarrierRate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.CarrierRate} CarrierRate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CarrierRate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CarrierRate message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CarrierRate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) { - properties._name = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - if (message.carrier != null && message.hasOwnProperty("carrier")) { - properties._carrier = 1; - if (!$util.isString(message.carrier)) - return "carrier: string expected"; - } - if (message.carrierService != null && message.hasOwnProperty("carrierService")) { - properties._carrierService = 1; - if (!$util.isString(message.carrierService)) - return "carrierService: string expected"; - } - if (message.originPostalCode != null && message.hasOwnProperty("originPostalCode")) { - properties._originPostalCode = 1; - if (!$util.isString(message.originPostalCode)) - return "originPostalCode: string expected"; - } - if (message.percentageAdjustment != null && message.hasOwnProperty("percentageAdjustment")) { - properties._percentageAdjustment = 1; - if (!$util.isString(message.percentageAdjustment)) - return "percentageAdjustment: string expected"; - } - if (message.flatAdjustment != null && message.hasOwnProperty("flatAdjustment")) { - properties._flatAdjustment = 1; - { - var error = $root.google.shopping.type.Price.verify(message.flatAdjustment); - if (error) - return "flatAdjustment." + error; - } - } - return null; - }; - - /** - * Creates a CarrierRate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.CarrierRate} CarrierRate - */ - CarrierRate.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.CarrierRate) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.CarrierRate(); - if (object.name != null) - message.name = String(object.name); - if (object.carrier != null) - message.carrier = String(object.carrier); - if (object.carrierService != null) - message.carrierService = String(object.carrierService); - if (object.originPostalCode != null) - message.originPostalCode = String(object.originPostalCode); - if (object.percentageAdjustment != null) - message.percentageAdjustment = String(object.percentageAdjustment); - if (object.flatAdjustment != null) { - if (typeof object.flatAdjustment !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.CarrierRate.flatAdjustment: object expected"); - message.flatAdjustment = $root.google.shopping.type.Price.fromObject(object.flatAdjustment); - } - return message; - }; - - /** - * Creates a plain object from a CarrierRate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @static - * @param {google.shopping.merchant.accounts.v1beta.CarrierRate} message CarrierRate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CarrierRate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object._name = "name"; - } - if (message.carrier != null && message.hasOwnProperty("carrier")) { - object.carrier = message.carrier; - if (options.oneofs) - object._carrier = "carrier"; - } - if (message.carrierService != null && message.hasOwnProperty("carrierService")) { - object.carrierService = message.carrierService; - if (options.oneofs) - object._carrierService = "carrierService"; - } - if (message.originPostalCode != null && message.hasOwnProperty("originPostalCode")) { - object.originPostalCode = message.originPostalCode; - if (options.oneofs) - object._originPostalCode = "originPostalCode"; - } - if (message.percentageAdjustment != null && message.hasOwnProperty("percentageAdjustment")) { - object.percentageAdjustment = message.percentageAdjustment; - if (options.oneofs) - object._percentageAdjustment = "percentageAdjustment"; - } - if (message.flatAdjustment != null && message.hasOwnProperty("flatAdjustment")) { - object.flatAdjustment = $root.google.shopping.type.Price.toObject(message.flatAdjustment, options); - if (options.oneofs) - object._flatAdjustment = "flatAdjustment"; - } - return object; - }; - - /** - * Converts this CarrierRate to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @instance - * @returns {Object.} JSON object - */ - CarrierRate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CarrierRate - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.CarrierRate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CarrierRate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.CarrierRate"; - }; - - return CarrierRate; - })(); - - v1beta.GetShippingSettingsRequest = (function() { - - /** - * Properties of a GetShippingSettingsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetShippingSettingsRequest - * @property {string|null} [name] GetShippingSettingsRequest name - */ - - /** - * Constructs a new GetShippingSettingsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetShippingSettingsRequest. - * @implements IGetShippingSettingsRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest=} [properties] Properties to set - */ - function GetShippingSettingsRequest(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]]; - } - - /** - * GetShippingSettingsRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @instance - */ - GetShippingSettingsRequest.prototype.name = ""; - - /** - * Creates a new GetShippingSettingsRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest} GetShippingSettingsRequest instance - */ - GetShippingSettingsRequest.create = function create(properties) { - return new GetShippingSettingsRequest(properties); - }; - - /** - * Encodes the specified GetShippingSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest} message GetShippingSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetShippingSettingsRequest.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 GetShippingSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest} message GetShippingSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetShippingSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetShippingSettingsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @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.GetShippingSettingsRequest} GetShippingSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetShippingSettingsRequest.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.GetShippingSettingsRequest(); - 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 GetShippingSettingsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest} GetShippingSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetShippingSettingsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetShippingSettingsRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetShippingSettingsRequest.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 GetShippingSettingsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest} GetShippingSettingsRequest - */ - GetShippingSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetShippingSettingsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest} message GetShippingSettingsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetShippingSettingsRequest.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 GetShippingSettingsRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @instance - * @returns {Object.} JSON object - */ - GetShippingSettingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetShippingSettingsRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetShippingSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest"; - }; - - return GetShippingSettingsRequest; - })(); - - v1beta.InsertShippingSettingsRequest = (function() { - - /** - * Properties of an InsertShippingSettingsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IInsertShippingSettingsRequest - * @property {string|null} [parent] InsertShippingSettingsRequest parent - * @property {google.shopping.merchant.accounts.v1beta.IShippingSettings|null} [shippingSetting] InsertShippingSettingsRequest shippingSetting - */ - - /** - * Constructs a new InsertShippingSettingsRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an InsertShippingSettingsRequest. - * @implements IInsertShippingSettingsRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest=} [properties] Properties to set - */ - function InsertShippingSettingsRequest(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]]; - } - - /** - * InsertShippingSettingsRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @instance - */ - InsertShippingSettingsRequest.prototype.parent = ""; - - /** - * InsertShippingSettingsRequest shippingSetting. - * @member {google.shopping.merchant.accounts.v1beta.IShippingSettings|null|undefined} shippingSetting - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @instance - */ - InsertShippingSettingsRequest.prototype.shippingSetting = null; - - /** - * Creates a new InsertShippingSettingsRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest} InsertShippingSettingsRequest instance - */ - InsertShippingSettingsRequest.create = function create(properties) { - return new InsertShippingSettingsRequest(properties); - }; - - /** - * Encodes the specified InsertShippingSettingsRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest} message InsertShippingSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InsertShippingSettingsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.shippingSetting != null && Object.hasOwnProperty.call(message, "shippingSetting")) - $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.encode(message.shippingSetting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InsertShippingSettingsRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest} message InsertShippingSettingsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InsertShippingSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InsertShippingSettingsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @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.InsertShippingSettingsRequest} InsertShippingSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InsertShippingSettingsRequest.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.InsertShippingSettingsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.shippingSetting = $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InsertShippingSettingsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest} InsertShippingSettingsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InsertShippingSettingsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InsertShippingSettingsRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InsertShippingSettingsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.shippingSetting != null && message.hasOwnProperty("shippingSetting")) { - var error = $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.verify(message.shippingSetting); - if (error) - return "shippingSetting." + error; - } - return null; - }; - - /** - * Creates an InsertShippingSettingsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest} InsertShippingSettingsRequest - */ - InsertShippingSettingsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.shippingSetting != null) { - if (typeof object.shippingSetting !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest.shippingSetting: object expected"); - message.shippingSetting = $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.fromObject(object.shippingSetting); - } - return message; - }; - - /** - * Creates a plain object from an InsertShippingSettingsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest} message InsertShippingSettingsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InsertShippingSettingsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.shippingSetting = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.shippingSetting != null && message.hasOwnProperty("shippingSetting")) - object.shippingSetting = $root.google.shopping.merchant.accounts.v1beta.ShippingSettings.toObject(message.shippingSetting, options); - return object; - }; - - /** - * Converts this InsertShippingSettingsRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @instance - * @returns {Object.} JSON object - */ - InsertShippingSettingsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InsertShippingSettingsRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InsertShippingSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest"; - }; - - return InsertShippingSettingsRequest; - })(); - - v1beta.TermsOfServiceService = (function() { - - /** - * Constructs a new TermsOfServiceService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a TermsOfServiceService - * @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 TermsOfServiceService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (TermsOfServiceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TermsOfServiceService; - - /** - * Creates new TermsOfServiceService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @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 {TermsOfServiceService} RPC service. Useful where requests and/or responses are streamed. - */ - TermsOfServiceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|getTermsOfService}. - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @typedef GetTermsOfServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.TermsOfService} [response] TermsOfService - */ - - /** - * Calls GetTermsOfService. - * @function getTermsOfService - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest} request GetTermsOfServiceRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceService.GetTermsOfServiceCallback} callback Node-style callback called with the error, if any, and TermsOfService - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TermsOfServiceService.prototype.getTermsOfService = function getTermsOfService(request, callback) { - return this.rpcCall(getTermsOfService, $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest, $root.google.shopping.merchant.accounts.v1beta.TermsOfService, request, callback); - }, "name", { value: "GetTermsOfService" }); - - /** - * Calls GetTermsOfService. - * @function getTermsOfService - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest} request GetTermsOfServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|retrieveLatestTermsOfService}. - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @typedef RetrieveLatestTermsOfServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.TermsOfService} [response] TermsOfService - */ - - /** - * Calls RetrieveLatestTermsOfService. - * @function retrieveLatestTermsOfService - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest} request RetrieveLatestTermsOfServiceRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceService.RetrieveLatestTermsOfServiceCallback} callback Node-style callback called with the error, if any, and TermsOfService - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TermsOfServiceService.prototype.retrieveLatestTermsOfService = function retrieveLatestTermsOfService(request, callback) { - return this.rpcCall(retrieveLatestTermsOfService, $root.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest, $root.google.shopping.merchant.accounts.v1beta.TermsOfService, request, callback); - }, "name", { value: "RetrieveLatestTermsOfService" }); - - /** - * Calls RetrieveLatestTermsOfService. - * @function retrieveLatestTermsOfService - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest} request RetrieveLatestTermsOfServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceService|acceptTermsOfService}. - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @typedef AcceptTermsOfServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls AcceptTermsOfService. - * @function acceptTermsOfService - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest} request AcceptTermsOfServiceRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceService.AcceptTermsOfServiceCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TermsOfServiceService.prototype.acceptTermsOfService = function acceptTermsOfService(request, callback) { - return this.rpcCall(acceptTermsOfService, $root.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "AcceptTermsOfService" }); - - /** - * Calls AcceptTermsOfService. - * @function acceptTermsOfService - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest} request AcceptTermsOfServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return TermsOfServiceService; - })(); - - v1beta.TermsOfService = (function() { - - /** - * Properties of a TermsOfService. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ITermsOfService - * @property {string|null} [name] TermsOfService name - * @property {string|null} [regionCode] TermsOfService regionCode - * @property {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null} [kind] TermsOfService kind - * @property {string|null} [fileUri] TermsOfService fileUri - * @property {boolean|null} [external] TermsOfService external - */ - - /** - * Constructs a new TermsOfService. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a TermsOfService. - * @implements ITermsOfService - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ITermsOfService=} [properties] Properties to set - */ - function TermsOfService(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TermsOfService name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @instance - */ - TermsOfService.prototype.name = ""; - - /** - * TermsOfService regionCode. - * @member {string} regionCode - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @instance - */ - TermsOfService.prototype.regionCode = ""; - - /** - * TermsOfService kind. - * @member {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind} kind - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @instance - */ - TermsOfService.prototype.kind = 0; - - /** - * TermsOfService fileUri. - * @member {string|null|undefined} fileUri - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @instance - */ - TermsOfService.prototype.fileUri = null; - - /** - * TermsOfService external. - * @member {boolean} external - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @instance - */ - TermsOfService.prototype.external = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TermsOfService _fileUri. - * @member {"fileUri"|undefined} _fileUri - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @instance - */ - Object.defineProperty(TermsOfService.prototype, "_fileUri", { - get: $util.oneOfGetter($oneOfFields = ["fileUri"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TermsOfService instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITermsOfService=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.TermsOfService} TermsOfService instance - */ - TermsOfService.create = function create(properties) { - return new TermsOfService(properties); - }; - - /** - * Encodes the specified TermsOfService message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfService.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITermsOfService} message TermsOfService message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TermsOfService.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kind); - if (message.fileUri != null && Object.hasOwnProperty.call(message, "fileUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.fileUri); - if (message.external != null && Object.hasOwnProperty.call(message, "external")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.external); - return writer; - }; - - /** - * Encodes the specified TermsOfService message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfService.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITermsOfService} message TermsOfService message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TermsOfService.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TermsOfService message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @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.TermsOfService} TermsOfService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TermsOfService.decode = function decode(reader, length) { - 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.TermsOfService(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.regionCode = reader.string(); - break; - } - case 3: { - message.kind = reader.int32(); - break; - } - case 4: { - message.fileUri = reader.string(); - break; - } - case 5: { - message.external = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TermsOfService message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.TermsOfService} TermsOfService - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TermsOfService.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TermsOfService message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TermsOfService.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - switch (message.kind) { - default: - return "kind: enum value expected"; - case 0: - case 1: - break; - } - if (message.fileUri != null && message.hasOwnProperty("fileUri")) { - properties._fileUri = 1; - if (!$util.isString(message.fileUri)) - return "fileUri: string expected"; - } - if (message.external != null && message.hasOwnProperty("external")) - if (typeof message.external !== "boolean") - return "external: boolean expected"; - return null; - }; - - /** - * Creates a TermsOfService message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.TermsOfService} TermsOfService - */ - TermsOfService.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TermsOfService) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.TermsOfService(); - if (object.name != null) - message.name = String(object.name); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - switch (object.kind) { - default: - if (typeof object.kind === "number") { - message.kind = object.kind; - break; - } - break; - case "TERMS_OF_SERVICE_KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "MERCHANT_CENTER": - case 1: - message.kind = 1; - break; - } - if (object.fileUri != null) - message.fileUri = String(object.fileUri); - if (object.external != null) - message.external = Boolean(object.external); - return message; - }; - - /** - * Creates a plain object from a TermsOfService message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @static - * @param {google.shopping.merchant.accounts.v1beta.TermsOfService} message TermsOfService - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TermsOfService.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.regionCode = ""; - object.kind = options.enums === String ? "TERMS_OF_SERVICE_KIND_UNSPECIFIED" : 0; - object.external = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.kind] === undefined ? message.kind : $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.kind] : message.kind; - if (message.fileUri != null && message.hasOwnProperty("fileUri")) { - object.fileUri = message.fileUri; - if (options.oneofs) - object._fileUri = "fileUri"; - } - if (message.external != null && message.hasOwnProperty("external")) - object.external = message.external; - return object; - }; - - /** - * Converts this TermsOfService to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @instance - * @returns {Object.} JSON object - */ - TermsOfService.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TermsOfService - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfService - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TermsOfService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TermsOfService"; - }; - - return TermsOfService; - })(); - - v1beta.GetTermsOfServiceRequest = (function() { - - /** - * Properties of a GetTermsOfServiceRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetTermsOfServiceRequest - * @property {string|null} [name] GetTermsOfServiceRequest name - */ - - /** - * Constructs a new GetTermsOfServiceRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetTermsOfServiceRequest. - * @implements IGetTermsOfServiceRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest=} [properties] Properties to set - */ - function GetTermsOfServiceRequest(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]]; - } - - /** - * GetTermsOfServiceRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @instance - */ - GetTermsOfServiceRequest.prototype.name = ""; - - /** - * Creates a new GetTermsOfServiceRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest} GetTermsOfServiceRequest instance - */ - GetTermsOfServiceRequest.create = function create(properties) { - return new GetTermsOfServiceRequest(properties); - }; - - /** - * Encodes the specified GetTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest} message GetTermsOfServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTermsOfServiceRequest.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 GetTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest} message GetTermsOfServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTermsOfServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTermsOfServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @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.GetTermsOfServiceRequest} GetTermsOfServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTermsOfServiceRequest.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.GetTermsOfServiceRequest(); - 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 GetTermsOfServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest} GetTermsOfServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTermsOfServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTermsOfServiceRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTermsOfServiceRequest.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 GetTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest} GetTermsOfServiceRequest - */ - GetTermsOfServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetTermsOfServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest} message GetTermsOfServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTermsOfServiceRequest.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 GetTermsOfServiceRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @instance - * @returns {Object.} JSON object - */ - GetTermsOfServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTermsOfServiceRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTermsOfServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest"; - }; - - return GetTermsOfServiceRequest; - })(); - - v1beta.RetrieveLatestTermsOfServiceRequest = (function() { - - /** - * Properties of a RetrieveLatestTermsOfServiceRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IRetrieveLatestTermsOfServiceRequest - * @property {string|null} [regionCode] RetrieveLatestTermsOfServiceRequest regionCode - * @property {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null} [kind] RetrieveLatestTermsOfServiceRequest kind - */ - - /** - * Constructs a new RetrieveLatestTermsOfServiceRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a RetrieveLatestTermsOfServiceRequest. - * @implements IRetrieveLatestTermsOfServiceRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest=} [properties] Properties to set - */ - function RetrieveLatestTermsOfServiceRequest(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]]; - } - - /** - * RetrieveLatestTermsOfServiceRequest regionCode. - * @member {string} regionCode - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @instance - */ - RetrieveLatestTermsOfServiceRequest.prototype.regionCode = ""; - - /** - * RetrieveLatestTermsOfServiceRequest kind. - * @member {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind} kind - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @instance - */ - RetrieveLatestTermsOfServiceRequest.prototype.kind = 0; - - /** - * Creates a new RetrieveLatestTermsOfServiceRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest} RetrieveLatestTermsOfServiceRequest instance - */ - RetrieveLatestTermsOfServiceRequest.create = function create(properties) { - return new RetrieveLatestTermsOfServiceRequest(properties); - }; - - /** - * Encodes the specified RetrieveLatestTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest} message RetrieveLatestTermsOfServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveLatestTermsOfServiceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.kind); - return writer; - }; - - /** - * Encodes the specified RetrieveLatestTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest} message RetrieveLatestTermsOfServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveLatestTermsOfServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveLatestTermsOfServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @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.RetrieveLatestTermsOfServiceRequest} RetrieveLatestTermsOfServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveLatestTermsOfServiceRequest.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.RetrieveLatestTermsOfServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.regionCode = reader.string(); - break; - } - case 2: { - message.kind = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveLatestTermsOfServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest} RetrieveLatestTermsOfServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveLatestTermsOfServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveLatestTermsOfServiceRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveLatestTermsOfServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - switch (message.kind) { - default: - return "kind: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a RetrieveLatestTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest} RetrieveLatestTermsOfServiceRequest - */ - RetrieveLatestTermsOfServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest(); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - switch (object.kind) { - default: - if (typeof object.kind === "number") { - message.kind = object.kind; - break; - } - break; - case "TERMS_OF_SERVICE_KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "MERCHANT_CENTER": - case 1: - message.kind = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a RetrieveLatestTermsOfServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest} message RetrieveLatestTermsOfServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveLatestTermsOfServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.regionCode = ""; - object.kind = options.enums === String ? "TERMS_OF_SERVICE_KIND_UNSPECIFIED" : 0; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.kind] === undefined ? message.kind : $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.kind] : message.kind; - return object; - }; - - /** - * Converts this RetrieveLatestTermsOfServiceRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @instance - * @returns {Object.} JSON object - */ - RetrieveLatestTermsOfServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveLatestTermsOfServiceRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveLatestTermsOfServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest"; - }; - - return RetrieveLatestTermsOfServiceRequest; - })(); - - v1beta.AcceptTermsOfServiceRequest = (function() { - - /** - * Properties of an AcceptTermsOfServiceRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IAcceptTermsOfServiceRequest - * @property {string|null} [name] AcceptTermsOfServiceRequest name - * @property {string|null} [account] AcceptTermsOfServiceRequest account - * @property {string|null} [regionCode] AcceptTermsOfServiceRequest regionCode - */ - - /** - * Constructs a new AcceptTermsOfServiceRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an AcceptTermsOfServiceRequest. - * @implements IAcceptTermsOfServiceRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest=} [properties] Properties to set - */ - function AcceptTermsOfServiceRequest(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]]; - } - - /** - * AcceptTermsOfServiceRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @instance - */ - AcceptTermsOfServiceRequest.prototype.name = ""; - - /** - * AcceptTermsOfServiceRequest account. - * @member {string} account - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @instance - */ - AcceptTermsOfServiceRequest.prototype.account = ""; - - /** - * AcceptTermsOfServiceRequest regionCode. - * @member {string} regionCode - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @instance - */ - AcceptTermsOfServiceRequest.prototype.regionCode = ""; - - /** - * Creates a new AcceptTermsOfServiceRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest} AcceptTermsOfServiceRequest instance - */ - AcceptTermsOfServiceRequest.create = function create(properties) { - return new AcceptTermsOfServiceRequest(properties); - }; - - /** - * Encodes the specified AcceptTermsOfServiceRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest} message AcceptTermsOfServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcceptTermsOfServiceRequest.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.account != null && Object.hasOwnProperty.call(message, "account")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.account); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.regionCode); - return writer; - }; - - /** - * Encodes the specified AcceptTermsOfServiceRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest} message AcceptTermsOfServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcceptTermsOfServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AcceptTermsOfServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @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.AcceptTermsOfServiceRequest} AcceptTermsOfServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcceptTermsOfServiceRequest.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.AcceptTermsOfServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.account = reader.string(); - break; - } - case 3: { - message.regionCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AcceptTermsOfServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest} AcceptTermsOfServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcceptTermsOfServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AcceptTermsOfServiceRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AcceptTermsOfServiceRequest.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.account != null && message.hasOwnProperty("account")) - if (!$util.isString(message.account)) - return "account: string expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - return null; - }; - - /** - * Creates an AcceptTermsOfServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest} AcceptTermsOfServiceRequest - */ - AcceptTermsOfServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.account != null) - message.account = String(object.account); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - return message; - }; - - /** - * Creates a plain object from an AcceptTermsOfServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest} message AcceptTermsOfServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AcceptTermsOfServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.account = ""; - object.regionCode = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.account != null && message.hasOwnProperty("account")) - object.account = message.account; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - return object; - }; - - /** - * Converts this AcceptTermsOfServiceRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @instance - * @returns {Object.} JSON object - */ - AcceptTermsOfServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AcceptTermsOfServiceRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AcceptTermsOfServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest"; - }; - - return AcceptTermsOfServiceRequest; - })(); - - /** - * TermsOfServiceKind enum. - * @name google.shopping.merchant.accounts.v1beta.TermsOfServiceKind - * @enum {number} - * @property {number} TERMS_OF_SERVICE_KIND_UNSPECIFIED=0 TERMS_OF_SERVICE_KIND_UNSPECIFIED value - * @property {number} MERCHANT_CENTER=1 MERCHANT_CENTER value - */ - v1beta.TermsOfServiceKind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TERMS_OF_SERVICE_KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "MERCHANT_CENTER"] = 1; - return values; - })(); - - v1beta.TermsOfServiceAgreementStateService = (function() { - - /** - * Constructs a new TermsOfServiceAgreementStateService service. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a TermsOfServiceAgreementStateService - * @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 TermsOfServiceAgreementStateService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (TermsOfServiceAgreementStateService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TermsOfServiceAgreementStateService; - - /** - * Creates new TermsOfServiceAgreementStateService service using the specified rpc implementation. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService - * @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 {TermsOfServiceAgreementStateService} RPC service. Useful where requests and/or responses are streamed. - */ - TermsOfServiceAgreementStateService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService|getTermsOfServiceAgreementState}. - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService - * @typedef GetTermsOfServiceAgreementStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} [response] TermsOfServiceAgreementState - */ - - /** - * Calls GetTermsOfServiceAgreementState. - * @function getTermsOfServiceAgreementState - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest} request GetTermsOfServiceAgreementStateRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.GetTermsOfServiceAgreementStateCallback} callback Node-style callback called with the error, if any, and TermsOfServiceAgreementState - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TermsOfServiceAgreementStateService.prototype.getTermsOfServiceAgreementState = function getTermsOfServiceAgreementState(request, callback) { - return this.rpcCall(getTermsOfServiceAgreementState, $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest, $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState, request, callback); - }, "name", { value: "GetTermsOfServiceAgreementState" }); - - /** - * Calls GetTermsOfServiceAgreementState. - * @function getTermsOfServiceAgreementState - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest} request GetTermsOfServiceAgreementStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService|retrieveForApplicationTermsOfServiceAgreementState}. - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService - * @typedef RetrieveForApplicationTermsOfServiceAgreementStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} [response] TermsOfServiceAgreementState - */ - - /** - * Calls RetrieveForApplicationTermsOfServiceAgreementState. - * @function retrieveForApplicationTermsOfServiceAgreementState - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest} request RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object - * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.RetrieveForApplicationTermsOfServiceAgreementStateCallback} callback Node-style callback called with the error, if any, and TermsOfServiceAgreementState - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TermsOfServiceAgreementStateService.prototype.retrieveForApplicationTermsOfServiceAgreementState = function retrieveForApplicationTermsOfServiceAgreementState(request, callback) { - return this.rpcCall(retrieveForApplicationTermsOfServiceAgreementState, $root.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest, $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState, request, callback); - }, "name", { value: "RetrieveForApplicationTermsOfServiceAgreementState" }); - - /** - * Calls RetrieveForApplicationTermsOfServiceAgreementState. - * @function retrieveForApplicationTermsOfServiceAgreementState - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService - * @instance - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest} request RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return TermsOfServiceAgreementStateService; - })(); - - v1beta.TermsOfServiceAgreementState = (function() { - - /** - * Properties of a TermsOfServiceAgreementState. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface ITermsOfServiceAgreementState - * @property {string|null} [name] TermsOfServiceAgreementState name - * @property {string|null} [regionCode] TermsOfServiceAgreementState regionCode - * @property {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind|null} [termsOfServiceKind] TermsOfServiceAgreementState termsOfServiceKind - * @property {google.shopping.merchant.accounts.v1beta.IAccepted|null} [accepted] TermsOfServiceAgreementState accepted - * @property {google.shopping.merchant.accounts.v1beta.IRequired|null} [required] TermsOfServiceAgreementState required - */ - - /** - * Constructs a new TermsOfServiceAgreementState. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a TermsOfServiceAgreementState. - * @implements ITermsOfServiceAgreementState - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState=} [properties] Properties to set - */ - function TermsOfServiceAgreementState(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]]; - } - - /** - * TermsOfServiceAgreementState name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @instance - */ - TermsOfServiceAgreementState.prototype.name = ""; - - /** - * TermsOfServiceAgreementState regionCode. - * @member {string} regionCode - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @instance - */ - TermsOfServiceAgreementState.prototype.regionCode = ""; - - /** - * TermsOfServiceAgreementState termsOfServiceKind. - * @member {google.shopping.merchant.accounts.v1beta.TermsOfServiceKind} termsOfServiceKind - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @instance - */ - TermsOfServiceAgreementState.prototype.termsOfServiceKind = 0; - - /** - * TermsOfServiceAgreementState accepted. - * @member {google.shopping.merchant.accounts.v1beta.IAccepted|null|undefined} accepted - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @instance - */ - TermsOfServiceAgreementState.prototype.accepted = null; - - /** - * TermsOfServiceAgreementState required. - * @member {google.shopping.merchant.accounts.v1beta.IRequired|null|undefined} required - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @instance - */ - TermsOfServiceAgreementState.prototype.required = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TermsOfServiceAgreementState _accepted. - * @member {"accepted"|undefined} _accepted - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @instance - */ - Object.defineProperty(TermsOfServiceAgreementState.prototype, "_accepted", { - get: $util.oneOfGetter($oneOfFields = ["accepted"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * TermsOfServiceAgreementState _required. - * @member {"required"|undefined} _required - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @instance - */ - Object.defineProperty(TermsOfServiceAgreementState.prototype, "_required", { - get: $util.oneOfGetter($oneOfFields = ["required"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TermsOfServiceAgreementState instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} TermsOfServiceAgreementState instance - */ - TermsOfServiceAgreementState.create = function create(properties) { - return new TermsOfServiceAgreementState(properties); - }; - - /** - * Encodes the specified TermsOfServiceAgreementState message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState} message TermsOfServiceAgreementState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TermsOfServiceAgreementState.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.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); - if (message.termsOfServiceKind != null && Object.hasOwnProperty.call(message, "termsOfServiceKind")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.termsOfServiceKind); - if (message.accepted != null && Object.hasOwnProperty.call(message, "accepted")) - $root.google.shopping.merchant.accounts.v1beta.Accepted.encode(message.accepted, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.required != null && Object.hasOwnProperty.call(message, "required")) - $root.google.shopping.merchant.accounts.v1beta.Required.encode(message.required, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TermsOfServiceAgreementState message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @static - * @param {google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState} message TermsOfServiceAgreementState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TermsOfServiceAgreementState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TermsOfServiceAgreementState message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @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.TermsOfServiceAgreementState} TermsOfServiceAgreementState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TermsOfServiceAgreementState.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.TermsOfServiceAgreementState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.regionCode = reader.string(); - break; - } - case 3: { - message.termsOfServiceKind = reader.int32(); - break; - } - case 4: { - message.accepted = $root.google.shopping.merchant.accounts.v1beta.Accepted.decode(reader, reader.uint32()); - break; - } - case 5: { - message.required = $root.google.shopping.merchant.accounts.v1beta.Required.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TermsOfServiceAgreementState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} TermsOfServiceAgreementState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TermsOfServiceAgreementState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TermsOfServiceAgreementState message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TermsOfServiceAgreementState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.termsOfServiceKind != null && message.hasOwnProperty("termsOfServiceKind")) - switch (message.termsOfServiceKind) { - default: - return "termsOfServiceKind: enum value expected"; - case 0: - case 1: - break; - } - if (message.accepted != null && message.hasOwnProperty("accepted")) { - properties._accepted = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Accepted.verify(message.accepted); - if (error) - return "accepted." + error; - } - } - if (message.required != null && message.hasOwnProperty("required")) { - properties._required = 1; - { - var error = $root.google.shopping.merchant.accounts.v1beta.Required.verify(message.required); - if (error) - return "required." + error; - } - } - return null; - }; - - /** - * Creates a TermsOfServiceAgreementState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} TermsOfServiceAgreementState - */ - TermsOfServiceAgreementState.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState(); - if (object.name != null) - message.name = String(object.name); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - switch (object.termsOfServiceKind) { - default: - if (typeof object.termsOfServiceKind === "number") { - message.termsOfServiceKind = object.termsOfServiceKind; - break; - } - break; - case "TERMS_OF_SERVICE_KIND_UNSPECIFIED": - case 0: - message.termsOfServiceKind = 0; - break; - case "MERCHANT_CENTER": - case 1: - message.termsOfServiceKind = 1; - break; - } - if (object.accepted != null) { - if (typeof object.accepted !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.accepted: object expected"); - message.accepted = $root.google.shopping.merchant.accounts.v1beta.Accepted.fromObject(object.accepted); - } - if (object.required != null) { - if (typeof object.required !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState.required: object expected"); - message.required = $root.google.shopping.merchant.accounts.v1beta.Required.fromObject(object.required); - } - return message; - }; - - /** - * Creates a plain object from a TermsOfServiceAgreementState message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @static - * @param {google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState} message TermsOfServiceAgreementState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TermsOfServiceAgreementState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.regionCode = ""; - object.termsOfServiceKind = options.enums === String ? "TERMS_OF_SERVICE_KIND_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.termsOfServiceKind != null && message.hasOwnProperty("termsOfServiceKind")) - object.termsOfServiceKind = options.enums === String ? $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.termsOfServiceKind] === undefined ? message.termsOfServiceKind : $root.google.shopping.merchant.accounts.v1beta.TermsOfServiceKind[message.termsOfServiceKind] : message.termsOfServiceKind; - if (message.accepted != null && message.hasOwnProperty("accepted")) { - object.accepted = $root.google.shopping.merchant.accounts.v1beta.Accepted.toObject(message.accepted, options); - if (options.oneofs) - object._accepted = "accepted"; - } - if (message.required != null && message.hasOwnProperty("required")) { - object.required = $root.google.shopping.merchant.accounts.v1beta.Required.toObject(message.required, options); - if (options.oneofs) - object._required = "required"; - } - return object; - }; - - /** - * Converts this TermsOfServiceAgreementState to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @instance - * @returns {Object.} JSON object - */ - TermsOfServiceAgreementState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TermsOfServiceAgreementState - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TermsOfServiceAgreementState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState"; - }; - - return TermsOfServiceAgreementState; - })(); - - v1beta.Accepted = (function() { - - /** - * Properties of an Accepted. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IAccepted - * @property {string|null} [termsOfService] Accepted termsOfService - * @property {string|null} [acceptedBy] Accepted acceptedBy - * @property {google.type.IDate|null} [validUntil] Accepted validUntil - */ - - /** - * Constructs a new Accepted. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents an Accepted. - * @implements IAccepted - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IAccepted=} [properties] Properties to set - */ - function Accepted(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]]; - } - - /** - * Accepted termsOfService. - * @member {string} termsOfService - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @instance - */ - Accepted.prototype.termsOfService = ""; - - /** - * Accepted acceptedBy. - * @member {string} acceptedBy - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @instance - */ - Accepted.prototype.acceptedBy = ""; - - /** - * Accepted validUntil. - * @member {google.type.IDate|null|undefined} validUntil - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @instance - */ - Accepted.prototype.validUntil = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Accepted _validUntil. - * @member {"validUntil"|undefined} _validUntil - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @instance - */ - Object.defineProperty(Accepted.prototype, "_validUntil", { - get: $util.oneOfGetter($oneOfFields = ["validUntil"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Accepted instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccepted=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Accepted} Accepted instance - */ - Accepted.create = function create(properties) { - return new Accepted(properties); - }; - - /** - * Encodes the specified Accepted message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Accepted.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccepted} message Accepted message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accepted.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.termsOfService != null && Object.hasOwnProperty.call(message, "termsOfService")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.termsOfService); - if (message.acceptedBy != null && Object.hasOwnProperty.call(message, "acceptedBy")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.acceptedBy); - if (message.validUntil != null && Object.hasOwnProperty.call(message, "validUntil")) - $root.google.type.Date.encode(message.validUntil, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Accepted message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Accepted.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @static - * @param {google.shopping.merchant.accounts.v1beta.IAccepted} message Accepted message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Accepted.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Accepted message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @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.Accepted} Accepted - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accepted.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.Accepted(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.termsOfService = reader.string(); - break; - } - case 2: { - message.acceptedBy = reader.string(); - break; - } - case 3: { - message.validUntil = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Accepted message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Accepted} Accepted - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Accepted.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Accepted message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Accepted.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.termsOfService != null && message.hasOwnProperty("termsOfService")) - if (!$util.isString(message.termsOfService)) - return "termsOfService: string expected"; - if (message.acceptedBy != null && message.hasOwnProperty("acceptedBy")) - if (!$util.isString(message.acceptedBy)) - return "acceptedBy: string expected"; - if (message.validUntil != null && message.hasOwnProperty("validUntil")) { - properties._validUntil = 1; - { - var error = $root.google.type.Date.verify(message.validUntil); - if (error) - return "validUntil." + error; - } - } - return null; - }; - - /** - * Creates an Accepted message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Accepted} Accepted - */ - Accepted.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Accepted) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Accepted(); - if (object.termsOfService != null) - message.termsOfService = String(object.termsOfService); - if (object.acceptedBy != null) - message.acceptedBy = String(object.acceptedBy); - if (object.validUntil != null) { - if (typeof object.validUntil !== "object") - throw TypeError(".google.shopping.merchant.accounts.v1beta.Accepted.validUntil: object expected"); - message.validUntil = $root.google.type.Date.fromObject(object.validUntil); - } - return message; - }; - - /** - * Creates a plain object from an Accepted message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @static - * @param {google.shopping.merchant.accounts.v1beta.Accepted} message Accepted - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Accepted.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.termsOfService = ""; - object.acceptedBy = ""; - } - if (message.termsOfService != null && message.hasOwnProperty("termsOfService")) - object.termsOfService = message.termsOfService; - if (message.acceptedBy != null && message.hasOwnProperty("acceptedBy")) - object.acceptedBy = message.acceptedBy; - if (message.validUntil != null && message.hasOwnProperty("validUntil")) { - object.validUntil = $root.google.type.Date.toObject(message.validUntil, options); - if (options.oneofs) - object._validUntil = "validUntil"; - } - return object; - }; - - /** - * Converts this Accepted to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @instance - * @returns {Object.} JSON object - */ - Accepted.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Accepted - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Accepted - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Accepted.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Accepted"; - }; - - return Accepted; - })(); - - v1beta.Required = (function() { - - /** - * Properties of a Required. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IRequired - * @property {string|null} [termsOfService] Required termsOfService - * @property {string|null} [tosFileUri] Required tosFileUri - */ - - /** - * Constructs a new Required. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a Required. - * @implements IRequired - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IRequired=} [properties] Properties to set - */ - function Required(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]]; - } - - /** - * Required termsOfService. - * @member {string} termsOfService - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @instance - */ - Required.prototype.termsOfService = ""; - - /** - * Required tosFileUri. - * @member {string} tosFileUri - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @instance - */ - Required.prototype.tosFileUri = ""; - - /** - * Creates a new Required instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRequired=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.Required} Required instance - */ - Required.create = function create(properties) { - return new Required(properties); - }; - - /** - * Encodes the specified Required message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Required.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRequired} message Required message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Required.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.termsOfService != null && Object.hasOwnProperty.call(message, "termsOfService")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.termsOfService); - if (message.tosFileUri != null && Object.hasOwnProperty.call(message, "tosFileUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tosFileUri); - return writer; - }; - - /** - * Encodes the specified Required message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.Required.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRequired} message Required message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Required.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Required message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @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.Required} Required - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Required.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.Required(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.termsOfService = reader.string(); - break; - } - case 2: { - message.tosFileUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Required message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.Required} Required - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Required.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Required message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Required.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.termsOfService != null && message.hasOwnProperty("termsOfService")) - if (!$util.isString(message.termsOfService)) - return "termsOfService: string expected"; - if (message.tosFileUri != null && message.hasOwnProperty("tosFileUri")) - if (!$util.isString(message.tosFileUri)) - return "tosFileUri: string expected"; - return null; - }; - - /** - * Creates a Required message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.Required} Required - */ - Required.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.Required) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.Required(); - if (object.termsOfService != null) - message.termsOfService = String(object.termsOfService); - if (object.tosFileUri != null) - message.tosFileUri = String(object.tosFileUri); - return message; - }; - - /** - * Creates a plain object from a Required message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @static - * @param {google.shopping.merchant.accounts.v1beta.Required} message Required - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Required.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.termsOfService = ""; - object.tosFileUri = ""; - } - if (message.termsOfService != null && message.hasOwnProperty("termsOfService")) - object.termsOfService = message.termsOfService; - if (message.tosFileUri != null && message.hasOwnProperty("tosFileUri")) - object.tosFileUri = message.tosFileUri; - return object; - }; - - /** - * Converts this Required to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @instance - * @returns {Object.} JSON object - */ - Required.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Required - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.Required - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Required.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.Required"; - }; - - return Required; - })(); - - v1beta.GetTermsOfServiceAgreementStateRequest = (function() { - - /** - * Properties of a GetTermsOfServiceAgreementStateRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IGetTermsOfServiceAgreementStateRequest - * @property {string|null} [name] GetTermsOfServiceAgreementStateRequest name - */ - - /** - * Constructs a new GetTermsOfServiceAgreementStateRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a GetTermsOfServiceAgreementStateRequest. - * @implements IGetTermsOfServiceAgreementStateRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest=} [properties] Properties to set - */ - function GetTermsOfServiceAgreementStateRequest(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]]; - } - - /** - * GetTermsOfServiceAgreementStateRequest name. - * @member {string} name - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @instance - */ - GetTermsOfServiceAgreementStateRequest.prototype.name = ""; - - /** - * Creates a new GetTermsOfServiceAgreementStateRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest} GetTermsOfServiceAgreementStateRequest instance - */ - GetTermsOfServiceAgreementStateRequest.create = function create(properties) { - return new GetTermsOfServiceAgreementStateRequest(properties); - }; - - /** - * Encodes the specified GetTermsOfServiceAgreementStateRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest} message GetTermsOfServiceAgreementStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTermsOfServiceAgreementStateRequest.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 GetTermsOfServiceAgreementStateRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest} message GetTermsOfServiceAgreementStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTermsOfServiceAgreementStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTermsOfServiceAgreementStateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @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.GetTermsOfServiceAgreementStateRequest} GetTermsOfServiceAgreementStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTermsOfServiceAgreementStateRequest.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.GetTermsOfServiceAgreementStateRequest(); - 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 GetTermsOfServiceAgreementStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest} GetTermsOfServiceAgreementStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTermsOfServiceAgreementStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTermsOfServiceAgreementStateRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTermsOfServiceAgreementStateRequest.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 GetTermsOfServiceAgreementStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest} GetTermsOfServiceAgreementStateRequest - */ - GetTermsOfServiceAgreementStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetTermsOfServiceAgreementStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest} message GetTermsOfServiceAgreementStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTermsOfServiceAgreementStateRequest.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 GetTermsOfServiceAgreementStateRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @instance - * @returns {Object.} JSON object - */ - GetTermsOfServiceAgreementStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTermsOfServiceAgreementStateRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTermsOfServiceAgreementStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest"; - }; - - return GetTermsOfServiceAgreementStateRequest; - })(); - - v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest = (function() { - - /** - * Properties of a RetrieveForApplicationTermsOfServiceAgreementStateRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @interface IRetrieveForApplicationTermsOfServiceAgreementStateRequest - * @property {string|null} [parent] RetrieveForApplicationTermsOfServiceAgreementStateRequest parent - */ - - /** - * Constructs a new RetrieveForApplicationTermsOfServiceAgreementStateRequest. - * @memberof google.shopping.merchant.accounts.v1beta - * @classdesc Represents a RetrieveForApplicationTermsOfServiceAgreementStateRequest. - * @implements IRetrieveForApplicationTermsOfServiceAgreementStateRequest - * @constructor - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest=} [properties] Properties to set - */ - function RetrieveForApplicationTermsOfServiceAgreementStateRequest(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]]; - } - - /** - * RetrieveForApplicationTermsOfServiceAgreementStateRequest parent. - * @member {string} parent - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @instance - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.prototype.parent = ""; - - /** - * Creates a new RetrieveForApplicationTermsOfServiceAgreementStateRequest instance using the specified properties. - * @function create - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest=} [properties] Properties to set - * @returns {google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest} RetrieveForApplicationTermsOfServiceAgreementStateRequest instance - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.create = function create(properties) { - return new RetrieveForApplicationTermsOfServiceAgreementStateRequest(properties); - }; - - /** - * Encodes the specified RetrieveForApplicationTermsOfServiceAgreementStateRequest message. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify|verify} messages. - * @function encode - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest} message RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - return writer; - }; - - /** - * Encodes the specified RetrieveForApplicationTermsOfServiceAgreementStateRequest message, length delimited. Does not implicitly {@link google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest} message RetrieveForApplicationTermsOfServiceAgreementStateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @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.RetrieveForApplicationTermsOfServiceAgreementStateRequest} RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.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.RetrieveForApplicationTermsOfServiceAgreementStateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest} RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetrieveForApplicationTermsOfServiceAgreementStateRequest message. - * @function verify - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - return null; - }; - - /** - * Creates a RetrieveForApplicationTermsOfServiceAgreementStateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest} RetrieveForApplicationTermsOfServiceAgreementStateRequest - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest) - return object; - var message = new $root.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - return message; - }; - - /** - * Creates a plain object from a RetrieveForApplicationTermsOfServiceAgreementStateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @static - * @param {google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest} message RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this RetrieveForApplicationTermsOfServiceAgreementStateRequest to JSON. - * @function toJSON - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @instance - * @returns {Object.} JSON object - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @function getTypeUrl - * @memberof google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetrieveForApplicationTermsOfServiceAgreementStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest"; - }; - - return RetrieveForApplicationTermsOfServiceAgreementStateRequest; - })(); - - return v1beta; - })(); - - return accounts; - })(); - - return merchant; - })(); - - shopping.type = (function() { - - /** - * Namespace type. - * @memberof google.shopping - * @namespace - */ - var type = {}; - - type.Weight = (function() { - - /** - * Properties of a Weight. - * @memberof google.shopping.type - * @interface IWeight - * @property {number|Long|null} [amountMicros] Weight amountMicros - * @property {google.shopping.type.Weight.WeightUnit|null} [unit] Weight unit - */ - - /** - * Constructs a new Weight. - * @memberof google.shopping.type - * @classdesc Represents a Weight. - * @implements IWeight - * @constructor - * @param {google.shopping.type.IWeight=} [properties] Properties to set - */ - function Weight(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]]; - } - - /** - * Weight amountMicros. - * @member {number|Long|null|undefined} amountMicros - * @memberof google.shopping.type.Weight - * @instance - */ - Weight.prototype.amountMicros = null; - - /** - * Weight unit. - * @member {google.shopping.type.Weight.WeightUnit} unit - * @memberof google.shopping.type.Weight - * @instance - */ - Weight.prototype.unit = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Weight _amountMicros. - * @member {"amountMicros"|undefined} _amountMicros - * @memberof google.shopping.type.Weight - * @instance - */ - Object.defineProperty(Weight.prototype, "_amountMicros", { - get: $util.oneOfGetter($oneOfFields = ["amountMicros"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Weight instance using the specified properties. - * @function create - * @memberof google.shopping.type.Weight - * @static - * @param {google.shopping.type.IWeight=} [properties] Properties to set - * @returns {google.shopping.type.Weight} Weight instance - */ - Weight.create = function create(properties) { - return new Weight(properties); - }; - - /** - * Encodes the specified Weight message. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages. - * @function encode - * @memberof google.shopping.type.Weight - * @static - * @param {google.shopping.type.IWeight} message Weight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Weight.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.amountMicros != null && Object.hasOwnProperty.call(message, "amountMicros")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amountMicros); - if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unit); - return writer; - }; - - /** - * Encodes the specified Weight message, length delimited. Does not implicitly {@link google.shopping.type.Weight.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.type.Weight - * @static - * @param {google.shopping.type.IWeight} message Weight message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Weight.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Weight message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.type.Weight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.shopping.type.Weight} Weight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Weight.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.type.Weight(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.amountMicros = reader.int64(); - break; - } - case 2: { - message.unit = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Weight message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.type.Weight - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.type.Weight} Weight - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Weight.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Weight message. - * @function verify - * @memberof google.shopping.type.Weight - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Weight.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) { - properties._amountMicros = 1; - if (!$util.isInteger(message.amountMicros) && !(message.amountMicros && $util.isInteger(message.amountMicros.low) && $util.isInteger(message.amountMicros.high))) - return "amountMicros: integer|Long expected"; - } - if (message.unit != null && message.hasOwnProperty("unit")) - switch (message.unit) { - default: - return "unit: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a Weight message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.type.Weight - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.type.Weight} Weight - */ - Weight.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.type.Weight) - return object; - var message = new $root.google.shopping.type.Weight(); - if (object.amountMicros != null) - if ($util.Long) - (message.amountMicros = $util.Long.fromValue(object.amountMicros)).unsigned = false; - else if (typeof object.amountMicros === "string") - message.amountMicros = parseInt(object.amountMicros, 10); - else if (typeof object.amountMicros === "number") - message.amountMicros = object.amountMicros; - else if (typeof object.amountMicros === "object") - message.amountMicros = new $util.LongBits(object.amountMicros.low >>> 0, object.amountMicros.high >>> 0).toNumber(); - switch (object.unit) { - default: - if (typeof object.unit === "number") { - message.unit = object.unit; - break; - } - break; - case "WEIGHT_UNIT_UNSPECIFIED": - case 0: - message.unit = 0; - break; - case "POUND": - case 1: - message.unit = 1; - break; - case "KILOGRAM": - case 2: - message.unit = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a Weight message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.type.Weight - * @static - * @param {google.shopping.type.Weight} message Weight - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Weight.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.unit = options.enums === String ? "WEIGHT_UNIT_UNSPECIFIED" : 0; - if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) { - if (typeof message.amountMicros === "number") - object.amountMicros = options.longs === String ? String(message.amountMicros) : message.amountMicros; - else - object.amountMicros = options.longs === String ? $util.Long.prototype.toString.call(message.amountMicros) : options.longs === Number ? new $util.LongBits(message.amountMicros.low >>> 0, message.amountMicros.high >>> 0).toNumber() : message.amountMicros; - if (options.oneofs) - object._amountMicros = "amountMicros"; - } - if (message.unit != null && message.hasOwnProperty("unit")) - object.unit = options.enums === String ? $root.google.shopping.type.Weight.WeightUnit[message.unit] === undefined ? message.unit : $root.google.shopping.type.Weight.WeightUnit[message.unit] : message.unit; - return object; - }; - - /** - * Converts this Weight to JSON. - * @function toJSON - * @memberof google.shopping.type.Weight - * @instance - * @returns {Object.} JSON object - */ - Weight.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Weight - * @function getTypeUrl - * @memberof google.shopping.type.Weight - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Weight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.type.Weight"; - }; - - /** - * WeightUnit enum. - * @name google.shopping.type.Weight.WeightUnit - * @enum {number} - * @property {number} WEIGHT_UNIT_UNSPECIFIED=0 WEIGHT_UNIT_UNSPECIFIED value - * @property {number} POUND=1 POUND value - * @property {number} KILOGRAM=2 KILOGRAM value - */ - Weight.WeightUnit = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WEIGHT_UNIT_UNSPECIFIED"] = 0; - values[valuesById[1] = "POUND"] = 1; - values[valuesById[2] = "KILOGRAM"] = 2; - return values; - })(); - - return Weight; - })(); - - type.Price = (function() { - - /** - * Properties of a Price. - * @memberof google.shopping.type - * @interface IPrice - * @property {number|Long|null} [amountMicros] Price amountMicros - * @property {string|null} [currencyCode] Price currencyCode - */ - - /** - * Constructs a new Price. - * @memberof google.shopping.type - * @classdesc Represents a Price. - * @implements IPrice - * @constructor - * @param {google.shopping.type.IPrice=} [properties] Properties to set - */ - function Price(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]]; - } - - /** - * Price amountMicros. - * @member {number|Long|null|undefined} amountMicros - * @memberof google.shopping.type.Price - * @instance - */ - Price.prototype.amountMicros = null; - - /** - * Price currencyCode. - * @member {string|null|undefined} currencyCode - * @memberof google.shopping.type.Price - * @instance - */ - Price.prototype.currencyCode = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Price _amountMicros. - * @member {"amountMicros"|undefined} _amountMicros - * @memberof google.shopping.type.Price - * @instance - */ - Object.defineProperty(Price.prototype, "_amountMicros", { - get: $util.oneOfGetter($oneOfFields = ["amountMicros"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Price _currencyCode. - * @member {"currencyCode"|undefined} _currencyCode - * @memberof google.shopping.type.Price - * @instance - */ - Object.defineProperty(Price.prototype, "_currencyCode", { - get: $util.oneOfGetter($oneOfFields = ["currencyCode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Price instance using the specified properties. - * @function create - * @memberof google.shopping.type.Price - * @static - * @param {google.shopping.type.IPrice=} [properties] Properties to set - * @returns {google.shopping.type.Price} Price instance - */ - Price.create = function create(properties) { - return new Price(properties); - }; - - /** - * Encodes the specified Price message. Does not implicitly {@link google.shopping.type.Price.verify|verify} messages. - * @function encode - * @memberof google.shopping.type.Price - * @static - * @param {google.shopping.type.IPrice} message Price message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Price.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.amountMicros != null && Object.hasOwnProperty.call(message, "amountMicros")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amountMicros); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.currencyCode); - return writer; - }; - - /** - * Encodes the specified Price message, length delimited. Does not implicitly {@link google.shopping.type.Price.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.type.Price - * @static - * @param {google.shopping.type.IPrice} message Price message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Price.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Price message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.type.Price - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.shopping.type.Price} Price - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Price.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.type.Price(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.amountMicros = reader.int64(); - break; - } - case 2: { - message.currencyCode = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Price message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.type.Price - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.type.Price} Price - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Price.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Price message. - * @function verify - * @memberof google.shopping.type.Price - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Price.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) { - properties._amountMicros = 1; - if (!$util.isInteger(message.amountMicros) && !(message.amountMicros && $util.isInteger(message.amountMicros.low) && $util.isInteger(message.amountMicros.high))) - return "amountMicros: integer|Long expected"; - } - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { - properties._currencyCode = 1; - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; - } - return null; - }; - - /** - * Creates a Price message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.type.Price - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.type.Price} Price - */ - Price.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.type.Price) - return object; - var message = new $root.google.shopping.type.Price(); - if (object.amountMicros != null) - if ($util.Long) - (message.amountMicros = $util.Long.fromValue(object.amountMicros)).unsigned = false; - else if (typeof object.amountMicros === "string") - message.amountMicros = parseInt(object.amountMicros, 10); - else if (typeof object.amountMicros === "number") - message.amountMicros = object.amountMicros; - else if (typeof object.amountMicros === "object") - message.amountMicros = new $util.LongBits(object.amountMicros.low >>> 0, object.amountMicros.high >>> 0).toNumber(); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); - return message; - }; - - /** - * Creates a plain object from a Price message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.type.Price - * @static - * @param {google.shopping.type.Price} message Price - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Price.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.amountMicros != null && message.hasOwnProperty("amountMicros")) { - if (typeof message.amountMicros === "number") - object.amountMicros = options.longs === String ? String(message.amountMicros) : message.amountMicros; - else - object.amountMicros = options.longs === String ? $util.Long.prototype.toString.call(message.amountMicros) : options.longs === Number ? new $util.LongBits(message.amountMicros.low >>> 0, message.amountMicros.high >>> 0).toNumber() : message.amountMicros; - if (options.oneofs) - object._amountMicros = "amountMicros"; - } - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) { - object.currencyCode = message.currencyCode; - if (options.oneofs) - object._currencyCode = "currencyCode"; - } - return object; - }; - - /** - * Converts this Price to JSON. - * @function toJSON - * @memberof google.shopping.type.Price - * @instance - * @returns {Object.} JSON object - */ - Price.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Price - * @function getTypeUrl - * @memberof google.shopping.type.Price - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Price.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.type.Price"; - }; - - return Price; - })(); - - type.CustomAttribute = (function() { - - /** - * Properties of a CustomAttribute. - * @memberof google.shopping.type - * @interface ICustomAttribute - * @property {string|null} [name] CustomAttribute name - * @property {string|null} [value] CustomAttribute value - * @property {Array.|null} [groupValues] CustomAttribute groupValues - */ - - /** - * Constructs a new CustomAttribute. - * @memberof google.shopping.type - * @classdesc Represents a CustomAttribute. - * @implements ICustomAttribute - * @constructor - * @param {google.shopping.type.ICustomAttribute=} [properties] Properties to set - */ - function CustomAttribute(properties) { - this.groupValues = []; - 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]]; - } - - /** - * CustomAttribute name. - * @member {string|null|undefined} name - * @memberof google.shopping.type.CustomAttribute - * @instance - */ - CustomAttribute.prototype.name = null; - - /** - * CustomAttribute value. - * @member {string|null|undefined} value - * @memberof google.shopping.type.CustomAttribute - * @instance - */ - CustomAttribute.prototype.value = null; - - /** - * CustomAttribute groupValues. - * @member {Array.} groupValues - * @memberof google.shopping.type.CustomAttribute - * @instance - */ - CustomAttribute.prototype.groupValues = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CustomAttribute _name. - * @member {"name"|undefined} _name - * @memberof google.shopping.type.CustomAttribute - * @instance - */ - Object.defineProperty(CustomAttribute.prototype, "_name", { - get: $util.oneOfGetter($oneOfFields = ["name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * CustomAttribute _value. - * @member {"value"|undefined} _value - * @memberof google.shopping.type.CustomAttribute - * @instance - */ - Object.defineProperty(CustomAttribute.prototype, "_value", { - get: $util.oneOfGetter($oneOfFields = ["value"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CustomAttribute instance using the specified properties. - * @function create - * @memberof google.shopping.type.CustomAttribute - * @static - * @param {google.shopping.type.ICustomAttribute=} [properties] Properties to set - * @returns {google.shopping.type.CustomAttribute} CustomAttribute instance - */ - CustomAttribute.create = function create(properties) { - return new CustomAttribute(properties); - }; - - /** - * Encodes the specified CustomAttribute message. Does not implicitly {@link google.shopping.type.CustomAttribute.verify|verify} messages. - * @function encode - * @memberof google.shopping.type.CustomAttribute - * @static - * @param {google.shopping.type.ICustomAttribute} message CustomAttribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomAttribute.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.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.groupValues != null && message.groupValues.length) - for (var i = 0; i < message.groupValues.length; ++i) - $root.google.shopping.type.CustomAttribute.encode(message.groupValues[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CustomAttribute message, length delimited. Does not implicitly {@link google.shopping.type.CustomAttribute.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.type.CustomAttribute - * @static - * @param {google.shopping.type.ICustomAttribute} message CustomAttribute message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomAttribute.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomAttribute message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.type.CustomAttribute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.shopping.type.CustomAttribute} CustomAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomAttribute.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.type.CustomAttribute(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - case 3: { - if (!(message.groupValues && message.groupValues.length)) - message.groupValues = []; - message.groupValues.push($root.google.shopping.type.CustomAttribute.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomAttribute message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.type.CustomAttribute - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.type.CustomAttribute} CustomAttribute - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomAttribute.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomAttribute message. - * @function verify - * @memberof google.shopping.type.CustomAttribute - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomAttribute.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) { - properties._name = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - if (message.value != null && message.hasOwnProperty("value")) { - properties._value = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - if (message.groupValues != null && message.hasOwnProperty("groupValues")) { - if (!Array.isArray(message.groupValues)) - return "groupValues: array expected"; - for (var i = 0; i < message.groupValues.length; ++i) { - var error = $root.google.shopping.type.CustomAttribute.verify(message.groupValues[i]); - if (error) - return "groupValues." + error; - } - } - return null; - }; - - /** - * Creates a CustomAttribute message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.type.CustomAttribute - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.type.CustomAttribute} CustomAttribute - */ - CustomAttribute.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.type.CustomAttribute) - return object; - var message = new $root.google.shopping.type.CustomAttribute(); - if (object.name != null) - message.name = String(object.name); - if (object.value != null) - message.value = String(object.value); - if (object.groupValues) { - if (!Array.isArray(object.groupValues)) - throw TypeError(".google.shopping.type.CustomAttribute.groupValues: array expected"); - message.groupValues = []; - for (var i = 0; i < object.groupValues.length; ++i) { - if (typeof object.groupValues[i] !== "object") - throw TypeError(".google.shopping.type.CustomAttribute.groupValues: object expected"); - message.groupValues[i] = $root.google.shopping.type.CustomAttribute.fromObject(object.groupValues[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CustomAttribute message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.type.CustomAttribute - * @static - * @param {google.shopping.type.CustomAttribute} message CustomAttribute - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomAttribute.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupValues = []; - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object._name = "name"; - } - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object._value = "value"; - } - if (message.groupValues && message.groupValues.length) { - object.groupValues = []; - for (var j = 0; j < message.groupValues.length; ++j) - object.groupValues[j] = $root.google.shopping.type.CustomAttribute.toObject(message.groupValues[j], options); - } - return object; - }; - - /** - * Converts this CustomAttribute to JSON. - * @function toJSON - * @memberof google.shopping.type.CustomAttribute - * @instance - * @returns {Object.} JSON object - */ - CustomAttribute.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomAttribute - * @function getTypeUrl - * @memberof google.shopping.type.CustomAttribute - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomAttribute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.type.CustomAttribute"; - }; - - return CustomAttribute; - })(); - - type.Destination = (function() { - - /** - * Properties of a Destination. - * @memberof google.shopping.type - * @interface IDestination - */ - - /** - * Constructs a new Destination. - * @memberof google.shopping.type - * @classdesc Represents a Destination. - * @implements IDestination - * @constructor - * @param {google.shopping.type.IDestination=} [properties] Properties to set - */ - function Destination(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 Destination instance using the specified properties. - * @function create - * @memberof google.shopping.type.Destination - * @static - * @param {google.shopping.type.IDestination=} [properties] Properties to set - * @returns {google.shopping.type.Destination} Destination instance - */ - Destination.create = function create(properties) { - return new Destination(properties); - }; - - /** - * Encodes the specified Destination message. Does not implicitly {@link google.shopping.type.Destination.verify|verify} messages. - * @function encode - * @memberof google.shopping.type.Destination - * @static - * @param {google.shopping.type.IDestination} message Destination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Destination.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.shopping.type.Destination.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.type.Destination - * @static - * @param {google.shopping.type.IDestination} message Destination message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Destination.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Destination message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.type.Destination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.shopping.type.Destination} Destination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Destination.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.type.Destination(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Destination message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.type.Destination - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.type.Destination} Destination - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Destination.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Destination message. - * @function verify - * @memberof google.shopping.type.Destination - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Destination.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a Destination message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.type.Destination - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.type.Destination} Destination - */ - Destination.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.type.Destination) - return object; - return new $root.google.shopping.type.Destination(); - }; - - /** - * Creates a plain object from a Destination message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.type.Destination - * @static - * @param {google.shopping.type.Destination} message Destination - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Destination.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Destination to JSON. - * @function toJSON - * @memberof google.shopping.type.Destination - * @instance - * @returns {Object.} JSON object - */ - Destination.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Destination - * @function getTypeUrl - * @memberof google.shopping.type.Destination - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Destination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.type.Destination"; - }; - - /** - * DestinationEnum enum. - * @name google.shopping.type.Destination.DestinationEnum - * @enum {number} - * @property {number} DESTINATION_ENUM_UNSPECIFIED=0 DESTINATION_ENUM_UNSPECIFIED value - * @property {number} SHOPPING_ADS=1 SHOPPING_ADS value - * @property {number} DISPLAY_ADS=2 DISPLAY_ADS value - * @property {number} LOCAL_INVENTORY_ADS=3 LOCAL_INVENTORY_ADS value - * @property {number} FREE_LISTINGS=4 FREE_LISTINGS value - * @property {number} FREE_LOCAL_LISTINGS=5 FREE_LOCAL_LISTINGS value - * @property {number} YOUTUBE_SHOPPING=6 YOUTUBE_SHOPPING value - */ - Destination.DestinationEnum = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DESTINATION_ENUM_UNSPECIFIED"] = 0; - values[valuesById[1] = "SHOPPING_ADS"] = 1; - values[valuesById[2] = "DISPLAY_ADS"] = 2; - values[valuesById[3] = "LOCAL_INVENTORY_ADS"] = 3; - values[valuesById[4] = "FREE_LISTINGS"] = 4; - values[valuesById[5] = "FREE_LOCAL_LISTINGS"] = 5; - values[valuesById[6] = "YOUTUBE_SHOPPING"] = 6; - return values; - })(); - - return Destination; - })(); - - type.ReportingContext = (function() { - - /** - * Properties of a ReportingContext. - * @memberof google.shopping.type - * @interface IReportingContext - */ - - /** - * Constructs a new ReportingContext. - * @memberof google.shopping.type - * @classdesc Represents a ReportingContext. - * @implements IReportingContext - * @constructor - * @param {google.shopping.type.IReportingContext=} [properties] Properties to set - */ - function ReportingContext(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 ReportingContext instance using the specified properties. - * @function create - * @memberof google.shopping.type.ReportingContext - * @static - * @param {google.shopping.type.IReportingContext=} [properties] Properties to set - * @returns {google.shopping.type.ReportingContext} ReportingContext instance - */ - ReportingContext.create = function create(properties) { - return new ReportingContext(properties); - }; - - /** - * Encodes the specified ReportingContext message. Does not implicitly {@link google.shopping.type.ReportingContext.verify|verify} messages. - * @function encode - * @memberof google.shopping.type.ReportingContext - * @static - * @param {google.shopping.type.IReportingContext} message ReportingContext message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReportingContext.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ReportingContext message, length delimited. Does not implicitly {@link google.shopping.type.ReportingContext.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.type.ReportingContext - * @static - * @param {google.shopping.type.IReportingContext} message ReportingContext message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReportingContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReportingContext message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.type.ReportingContext - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.shopping.type.ReportingContext} ReportingContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReportingContext.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.type.ReportingContext(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReportingContext message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.type.ReportingContext - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.type.ReportingContext} ReportingContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReportingContext.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReportingContext message. - * @function verify - * @memberof google.shopping.type.ReportingContext - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReportingContext.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a ReportingContext message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.type.ReportingContext - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.type.ReportingContext} ReportingContext - */ - ReportingContext.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.type.ReportingContext) - return object; - return new $root.google.shopping.type.ReportingContext(); - }; - - /** - * Creates a plain object from a ReportingContext message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.type.ReportingContext - * @static - * @param {google.shopping.type.ReportingContext} message ReportingContext - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReportingContext.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ReportingContext to JSON. - * @function toJSON - * @memberof google.shopping.type.ReportingContext - * @instance - * @returns {Object.} JSON object - */ - ReportingContext.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReportingContext - * @function getTypeUrl - * @memberof google.shopping.type.ReportingContext - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReportingContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.type.ReportingContext"; - }; - - /** - * ReportingContextEnum enum. - * @name google.shopping.type.ReportingContext.ReportingContextEnum - * @enum {number} - * @property {number} REPORTING_CONTEXT_ENUM_UNSPECIFIED=0 REPORTING_CONTEXT_ENUM_UNSPECIFIED value - * @property {number} SHOPPING_ADS=1 SHOPPING_ADS value - * @property {number} DISCOVERY_ADS=2 DISCOVERY_ADS value - * @property {number} DEMAND_GEN_ADS=13 DEMAND_GEN_ADS value - * @property {number} DEMAND_GEN_ADS_DISCOVER_SURFACE=14 DEMAND_GEN_ADS_DISCOVER_SURFACE value - * @property {number} VIDEO_ADS=3 VIDEO_ADS value - * @property {number} DISPLAY_ADS=4 DISPLAY_ADS value - * @property {number} LOCAL_INVENTORY_ADS=5 LOCAL_INVENTORY_ADS value - * @property {number} VEHICLE_INVENTORY_ADS=6 VEHICLE_INVENTORY_ADS value - * @property {number} FREE_LISTINGS=7 FREE_LISTINGS value - * @property {number} FREE_LOCAL_LISTINGS=8 FREE_LOCAL_LISTINGS value - * @property {number} FREE_LOCAL_VEHICLE_LISTINGS=9 FREE_LOCAL_VEHICLE_LISTINGS value - * @property {number} YOUTUBE_SHOPPING=10 YOUTUBE_SHOPPING value - * @property {number} CLOUD_RETAIL=11 CLOUD_RETAIL value - * @property {number} LOCAL_CLOUD_RETAIL=12 LOCAL_CLOUD_RETAIL value - */ - ReportingContext.ReportingContextEnum = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPORTING_CONTEXT_ENUM_UNSPECIFIED"] = 0; - values[valuesById[1] = "SHOPPING_ADS"] = 1; - values[valuesById[2] = "DISCOVERY_ADS"] = 2; - values[valuesById[13] = "DEMAND_GEN_ADS"] = 13; - values[valuesById[14] = "DEMAND_GEN_ADS_DISCOVER_SURFACE"] = 14; - values[valuesById[3] = "VIDEO_ADS"] = 3; - values[valuesById[4] = "DISPLAY_ADS"] = 4; - values[valuesById[5] = "LOCAL_INVENTORY_ADS"] = 5; - values[valuesById[6] = "VEHICLE_INVENTORY_ADS"] = 6; - values[valuesById[7] = "FREE_LISTINGS"] = 7; - values[valuesById[8] = "FREE_LOCAL_LISTINGS"] = 8; - values[valuesById[9] = "FREE_LOCAL_VEHICLE_LISTINGS"] = 9; - values[valuesById[10] = "YOUTUBE_SHOPPING"] = 10; - values[valuesById[11] = "CLOUD_RETAIL"] = 11; - values[valuesById[12] = "LOCAL_CLOUD_RETAIL"] = 12; - return values; - })(); - - return ReportingContext; - })(); - - type.Channel = (function() { - - /** - * Properties of a Channel. - * @memberof google.shopping.type - * @interface IChannel - */ - - /** - * Constructs a new Channel. - * @memberof google.shopping.type - * @classdesc Represents a Channel. - * @implements IChannel - * @constructor - * @param {google.shopping.type.IChannel=} [properties] Properties to set - */ - function Channel(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 Channel instance using the specified properties. - * @function create - * @memberof google.shopping.type.Channel - * @static - * @param {google.shopping.type.IChannel=} [properties] Properties to set - * @returns {google.shopping.type.Channel} Channel instance - */ - Channel.create = function create(properties) { - return new Channel(properties); - }; - - /** - * Encodes the specified Channel message. Does not implicitly {@link google.shopping.type.Channel.verify|verify} messages. - * @function encode - * @memberof google.shopping.type.Channel - * @static - * @param {google.shopping.type.IChannel} message Channel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Channel.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Channel message, length delimited. Does not implicitly {@link google.shopping.type.Channel.verify|verify} messages. - * @function encodeDelimited - * @memberof google.shopping.type.Channel - * @static - * @param {google.shopping.type.IChannel} message Channel message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Channel.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Channel message from the specified reader or buffer. - * @function decode - * @memberof google.shopping.type.Channel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.shopping.type.Channel} Channel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Channel.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.type.Channel(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Channel message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.shopping.type.Channel - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.shopping.type.Channel} Channel - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Channel.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Channel message. - * @function verify - * @memberof google.shopping.type.Channel - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Channel.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a Channel message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.shopping.type.Channel - * @static - * @param {Object.} object Plain object - * @returns {google.shopping.type.Channel} Channel - */ - Channel.fromObject = function fromObject(object) { - if (object instanceof $root.google.shopping.type.Channel) - return object; - return new $root.google.shopping.type.Channel(); - }; - - /** - * Creates a plain object from a Channel message. Also converts values to other types if specified. - * @function toObject - * @memberof google.shopping.type.Channel - * @static - * @param {google.shopping.type.Channel} message Channel - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Channel.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Channel to JSON. - * @function toJSON - * @memberof google.shopping.type.Channel - * @instance - * @returns {Object.} JSON object - */ - Channel.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Channel - * @function getTypeUrl - * @memberof google.shopping.type.Channel - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Channel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.shopping.type.Channel"; - }; - - /** - * ChannelEnum enum. - * @name google.shopping.type.Channel.ChannelEnum - * @enum {number} - * @property {number} CHANNEL_ENUM_UNSPECIFIED=0 CHANNEL_ENUM_UNSPECIFIED value - * @property {number} ONLINE=1 ONLINE value - * @property {number} LOCAL=2 LOCAL value - */ - Channel.ChannelEnum = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CHANNEL_ENUM_UNSPECIFIED"] = 0; - values[valuesById[1] = "ONLINE"] = 1; - values[valuesById[2] = "LOCAL"] = 2; - return values; - })(); - - return Channel; - })(); - - return type; - })(); - - return shopping; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - 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]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.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.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - 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]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.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.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(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]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.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.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - 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]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.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.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) - object.referenceDocsUri = ""; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(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]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.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.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - 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]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.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.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Publishing) - return object; - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - 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]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.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.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.JavaSettings) - return object; - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(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]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.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.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CppSettings) - return object; - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(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]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.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.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PhpSettings) - return object; - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(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]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.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.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.PythonSettings) - return object; - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(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]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.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.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.NodeSettings) - return object; - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - 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]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.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.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(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]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.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.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.RubySettings) - return object; - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(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]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.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.api.GoSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.GoSettings) - return object; - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - 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]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.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.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings) - return object; - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(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]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.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.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - } - case 3: { - message.nameField = reader.string(); - break; - } - case 4: { - message.history = reader.int32(); - break; - } - case 5: { - message.plural = reader.string(); - break; - } - case 6: { - message.singular = reader.string(); - break; - } - case 10: { - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceDescriptor message. - * @function verify - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { - if (!Array.isArray(message.style)) - return "style: array expected"; - for (var i = 0; i < message.style.length; ++i) - switch (message.style[i]) { - default: - return "style: enum value[] expected"; - case 0: - case 1: - break; - } - } - return null; - }; - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) - return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - default: - if (typeof object.history === "number") { - message.history = object.history; - break; - } - break; - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - if (typeof object.style[i] === "number") { - message.style[i] = object.style[i]; - break; - } - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } - return object; - }; - - /** - * Converts this ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor - * @instance - * @returns {Object.} JSON object - */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceDescriptor - * @function getTypeUrl - * @memberof google.api.ResourceDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceDescriptor"; - }; - - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * Style enum. - * @name google.api.ResourceDescriptor.Style - * @enum {number} - * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value - * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value - */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); - - return ResourceDescriptor; - })(); - - api.ResourceReference = (function() { - - /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType - */ - - /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set - */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @function create - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance - */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); - }; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); - return writer; - }; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ResourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceReference message. - * @function verify - * @memberof google.api.ResourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; - return null; - }; - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ResourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference - */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) - return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); - return message; - }; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ResourceReference - * @static - * @param {google.api.ResourceReference} message ResourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - object.childType = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; - return object; - }; - - /** - * Converts this ResourceReference to JSON. - * @function toJSON - * @memberof google.api.ResourceReference - * @instance - * @returns {Object.} JSON object - */ - ResourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceReference - * @function getTypeUrl - * @memberof google.api.ResourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ResourceReference"; - }; - - return ResourceReference; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - 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]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.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.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - 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]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.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["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.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.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - 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]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.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.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.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.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.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.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(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]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.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.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(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]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.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.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - 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]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.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.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(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]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.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.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(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]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.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.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.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.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.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.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(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]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.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.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.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.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.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.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - 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]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.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.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.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.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.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.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(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]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.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.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(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]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.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.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.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.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - 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]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.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.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.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.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.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.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(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]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.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.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.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.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.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.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.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.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.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.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - 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]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.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.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(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]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.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.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.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.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.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.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.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.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.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.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - 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]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.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.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - 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]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.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.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(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]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.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.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(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]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.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.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - 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]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.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.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(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]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.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.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - 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]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.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.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - 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]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.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.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - 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]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.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.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(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]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.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.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(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]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.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.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(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]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.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.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DoubleValue - * @function getTypeUrl - * @memberof google.protobuf.DoubleValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DoubleValue"; - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(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]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.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.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FloatValue - * @function getTypeUrl - * @memberof google.protobuf.FloatValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FloatValue"; - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(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]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.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.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int64Value - * @function getTypeUrl - * @memberof google.protobuf.Int64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int64Value"; - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(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]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.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.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.uint64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt64Value - * @function getTypeUrl - * @memberof google.protobuf.UInt64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt64Value"; - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(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]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.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.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int32Value - * @function getTypeUrl - * @memberof google.protobuf.Int32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int32Value"; - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(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]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.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.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt32Value - * @function getTypeUrl - * @memberof google.protobuf.UInt32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt32Value"; - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(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]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.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.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoolValue - * @function getTypeUrl - * @memberof google.protobuf.BoolValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BoolValue"; - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(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]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.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.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringValue - * @function getTypeUrl - * @memberof google.protobuf.StringValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.StringValue"; - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(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]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.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.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BytesValue - * @function getTypeUrl - * @memberof google.protobuf.BytesValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BytesValue"; - }; - - return BytesValue; - })(); - - return protobuf; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Interval = (function() { - - /** - * Properties of an Interval. - * @memberof google.type - * @interface IInterval - * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime - */ - - /** - * Constructs a new Interval. - * @memberof google.type - * @classdesc Represents an Interval. - * @implements IInterval - * @constructor - * @param {google.type.IInterval=} [properties] Properties to set - */ - function Interval(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]]; - } - - /** - * Interval startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.startTime = null; - - /** - * Interval endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.endTime = null; - - /** - * Creates a new Interval instance using the specified properties. - * @function create - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval=} [properties] Properties to set - * @returns {google.type.Interval} Interval instance - */ - Interval.create = function create(properties) { - return new Interval(properties); - }; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encode - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @function decode - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.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.type.Interval(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Interval message. - * @function verify - * @memberof google.type.Interval - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Interval.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Interval - * @static - * @param {Object.} object Plain object - * @returns {google.type.Interval} Interval - */ - Interval.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Interval) - return object; - var message = new $root.google.type.Interval(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.type.Interval.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.type.Interval.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Interval - * @static - * @param {google.type.Interval} message Interval - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Interval.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this Interval to JSON. - * @function toJSON - * @memberof google.type.Interval - * @instance - * @returns {Object.} JSON object - */ - Interval.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Interval - * @function getTypeUrl - * @memberof google.type.Interval - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Interval"; - }; - - return Interval; - })(); - - type.DateTime = (function() { - - /** - * Properties of a DateTime. - * @memberof google.type - * @interface IDateTime - * @property {number|null} [year] DateTime year - * @property {number|null} [month] DateTime month - * @property {number|null} [day] DateTime day - * @property {number|null} [hours] DateTime hours - * @property {number|null} [minutes] DateTime minutes - * @property {number|null} [seconds] DateTime seconds - * @property {number|null} [nanos] DateTime nanos - * @property {google.protobuf.IDuration|null} [utcOffset] DateTime utcOffset - * @property {google.type.ITimeZone|null} [timeZone] DateTime timeZone - */ - - /** - * Constructs a new DateTime. - * @memberof google.type - * @classdesc Represents a DateTime. - * @implements IDateTime - * @constructor - * @param {google.type.IDateTime=} [properties] Properties to set - */ - function DateTime(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]]; - } - - /** - * DateTime year. - * @member {number} year - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.year = 0; - - /** - * DateTime month. - * @member {number} month - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.month = 0; - - /** - * DateTime day. - * @member {number} day - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.day = 0; - - /** - * DateTime hours. - * @member {number} hours - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.hours = 0; - - /** - * DateTime minutes. - * @member {number} minutes - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.minutes = 0; - - /** - * DateTime seconds. - * @member {number} seconds - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.seconds = 0; - - /** - * DateTime nanos. - * @member {number} nanos - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.nanos = 0; - - /** - * DateTime utcOffset. - * @member {google.protobuf.IDuration|null|undefined} utcOffset - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.utcOffset = null; - - /** - * DateTime timeZone. - * @member {google.type.ITimeZone|null|undefined} timeZone - * @memberof google.type.DateTime - * @instance - */ - DateTime.prototype.timeZone = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DateTime timeOffset. - * @member {"utcOffset"|"timeZone"|undefined} timeOffset - * @memberof google.type.DateTime - * @instance - */ - Object.defineProperty(DateTime.prototype, "timeOffset", { - get: $util.oneOfGetter($oneOfFields = ["utcOffset", "timeZone"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DateTime instance using the specified properties. - * @function create - * @memberof google.type.DateTime - * @static - * @param {google.type.IDateTime=} [properties] Properties to set - * @returns {google.type.DateTime} DateTime instance - */ - DateTime.create = function create(properties) { - return new DateTime(properties); - }; - - /** - * Encodes the specified DateTime message. Does not implicitly {@link google.type.DateTime.verify|verify} messages. - * @function encode - * @memberof google.type.DateTime - * @static - * @param {google.type.IDateTime} message DateTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DateTime.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.year != null && Object.hasOwnProperty.call(message, "year")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); - if (message.month != null && Object.hasOwnProperty.call(message, "month")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); - if (message.day != null && Object.hasOwnProperty.call(message, "day")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); - if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hours); - if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minutes); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.nanos); - if (message.utcOffset != null && Object.hasOwnProperty.call(message, "utcOffset")) - $root.google.protobuf.Duration.encode(message.utcOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - $root.google.type.TimeZone.encode(message.timeZone, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DateTime message, length delimited. Does not implicitly {@link google.type.DateTime.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.DateTime - * @static - * @param {google.type.IDateTime} message DateTime message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DateTime.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DateTime message from the specified reader or buffer. - * @function decode - * @memberof google.type.DateTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.DateTime} DateTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DateTime.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.type.DateTime(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.year = reader.int32(); - break; - } - case 2: { - message.month = reader.int32(); - break; - } - case 3: { - message.day = reader.int32(); - break; - } - case 4: { - message.hours = reader.int32(); - break; - } - case 5: { - message.minutes = reader.int32(); - break; - } - case 6: { - message.seconds = reader.int32(); - break; - } - case 7: { - message.nanos = reader.int32(); - break; - } - case 8: { - message.utcOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - message.timeZone = $root.google.type.TimeZone.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DateTime message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.DateTime - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.DateTime} DateTime - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DateTime.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DateTime message. - * @function verify - * @memberof google.type.DateTime - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DateTime.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.year != null && message.hasOwnProperty("year")) - if (!$util.isInteger(message.year)) - return "year: integer expected"; - if (message.month != null && message.hasOwnProperty("month")) - if (!$util.isInteger(message.month)) - return "month: integer expected"; - if (message.day != null && message.hasOwnProperty("day")) - if (!$util.isInteger(message.day)) - return "day: integer expected"; - if (message.hours != null && message.hasOwnProperty("hours")) - if (!$util.isInteger(message.hours)) - return "hours: integer expected"; - if (message.minutes != null && message.hasOwnProperty("minutes")) - if (!$util.isInteger(message.minutes)) - return "minutes: integer expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds)) - return "seconds: integer expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { - properties.timeOffset = 1; - { - var error = $root.google.protobuf.Duration.verify(message.utcOffset); - if (error) - return "utcOffset." + error; - } - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) { - if (properties.timeOffset === 1) - return "timeOffset: multiple values"; - properties.timeOffset = 1; - { - var error = $root.google.type.TimeZone.verify(message.timeZone); - if (error) - return "timeZone." + error; - } - } - return null; - }; - - /** - * Creates a DateTime message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.DateTime - * @static - * @param {Object.} object Plain object - * @returns {google.type.DateTime} DateTime - */ - DateTime.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.DateTime) - return object; - var message = new $root.google.type.DateTime(); - if (object.year != null) - message.year = object.year | 0; - if (object.month != null) - message.month = object.month | 0; - if (object.day != null) - message.day = object.day | 0; - if (object.hours != null) - message.hours = object.hours | 0; - if (object.minutes != null) - message.minutes = object.minutes | 0; - if (object.seconds != null) - message.seconds = object.seconds | 0; - if (object.nanos != null) - message.nanos = object.nanos | 0; - if (object.utcOffset != null) { - if (typeof object.utcOffset !== "object") - throw TypeError(".google.type.DateTime.utcOffset: object expected"); - message.utcOffset = $root.google.protobuf.Duration.fromObject(object.utcOffset); - } - if (object.timeZone != null) { - if (typeof object.timeZone !== "object") - throw TypeError(".google.type.DateTime.timeZone: object expected"); - message.timeZone = $root.google.type.TimeZone.fromObject(object.timeZone); - } - return message; - }; - - /** - * Creates a plain object from a DateTime message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.DateTime - * @static - * @param {google.type.DateTime} message DateTime - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DateTime.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.year = 0; - object.month = 0; - object.day = 0; - object.hours = 0; - object.minutes = 0; - object.seconds = 0; - object.nanos = 0; - } - if (message.year != null && message.hasOwnProperty("year")) - object.year = message.year; - if (message.month != null && message.hasOwnProperty("month")) - object.month = message.month; - if (message.day != null && message.hasOwnProperty("day")) - object.day = message.day; - if (message.hours != null && message.hasOwnProperty("hours")) - object.hours = message.hours; - if (message.minutes != null && message.hasOwnProperty("minutes")) - object.minutes = message.minutes; - if (message.seconds != null && message.hasOwnProperty("seconds")) - object.seconds = message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - if (message.utcOffset != null && message.hasOwnProperty("utcOffset")) { - object.utcOffset = $root.google.protobuf.Duration.toObject(message.utcOffset, options); - if (options.oneofs) - object.timeOffset = "utcOffset"; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) { - object.timeZone = $root.google.type.TimeZone.toObject(message.timeZone, options); - if (options.oneofs) - object.timeOffset = "timeZone"; - } - return object; - }; - - /** - * Converts this DateTime to JSON. - * @function toJSON - * @memberof google.type.DateTime - * @instance - * @returns {Object.} JSON object - */ - DateTime.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DateTime - * @function getTypeUrl - * @memberof google.type.DateTime - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DateTime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.DateTime"; - }; - - return DateTime; - })(); - - type.TimeZone = (function() { - - /** - * Properties of a TimeZone. - * @memberof google.type - * @interface ITimeZone - * @property {string|null} [id] TimeZone id - * @property {string|null} [version] TimeZone version - */ - - /** - * Constructs a new TimeZone. - * @memberof google.type - * @classdesc Represents a TimeZone. - * @implements ITimeZone - * @constructor - * @param {google.type.ITimeZone=} [properties] Properties to set - */ - function TimeZone(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]]; - } - - /** - * TimeZone id. - * @member {string} id - * @memberof google.type.TimeZone - * @instance - */ - TimeZone.prototype.id = ""; - - /** - * TimeZone version. - * @member {string} version - * @memberof google.type.TimeZone - * @instance - */ - TimeZone.prototype.version = ""; - - /** - * Creates a new TimeZone instance using the specified properties. - * @function create - * @memberof google.type.TimeZone - * @static - * @param {google.type.ITimeZone=} [properties] Properties to set - * @returns {google.type.TimeZone} TimeZone instance - */ - TimeZone.create = function create(properties) { - return new TimeZone(properties); - }; - - /** - * Encodes the specified TimeZone message. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. - * @function encode - * @memberof google.type.TimeZone - * @static - * @param {google.type.ITimeZone} message TimeZone message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeZone.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - return writer; - }; - - /** - * Encodes the specified TimeZone message, length delimited. Does not implicitly {@link google.type.TimeZone.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.TimeZone - * @static - * @param {google.type.ITimeZone} message TimeZone message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimeZone.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TimeZone message from the specified reader or buffer. - * @function decode - * @memberof google.type.TimeZone - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.TimeZone} TimeZone - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeZone.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.type.TimeZone(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TimeZone message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.TimeZone - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.TimeZone} TimeZone - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimeZone.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TimeZone message. - * @function verify - * @memberof google.type.TimeZone - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimeZone.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - return null; - }; - - /** - * Creates a TimeZone message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.TimeZone - * @static - * @param {Object.} object Plain object - * @returns {google.type.TimeZone} TimeZone - */ - TimeZone.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.TimeZone) - return object; - var message = new $root.google.type.TimeZone(); - if (object.id != null) - message.id = String(object.id); - if (object.version != null) - message.version = String(object.version); - return message; - }; - - /** - * Creates a plain object from a TimeZone message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.TimeZone - * @static - * @param {google.type.TimeZone} message TimeZone - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimeZone.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.version = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this TimeZone to JSON. - * @function toJSON - * @memberof google.type.TimeZone - * @instance - * @returns {Object.} JSON object - */ - TimeZone.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TimeZone - * @function getTypeUrl - * @memberof google.type.TimeZone - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimeZone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.TimeZone"; - }; - - return TimeZone; - })(); - - type.PhoneNumber = (function() { - - /** - * Properties of a PhoneNumber. - * @memberof google.type - * @interface IPhoneNumber - * @property {string|null} [e164Number] PhoneNumber e164Number - * @property {google.type.PhoneNumber.IShortCode|null} [shortCode] PhoneNumber shortCode - * @property {string|null} [extension] PhoneNumber extension - */ - - /** - * Constructs a new PhoneNumber. - * @memberof google.type - * @classdesc Represents a PhoneNumber. - * @implements IPhoneNumber - * @constructor - * @param {google.type.IPhoneNumber=} [properties] Properties to set - */ - function PhoneNumber(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]]; - } - - /** - * PhoneNumber e164Number. - * @member {string|null|undefined} e164Number - * @memberof google.type.PhoneNumber - * @instance - */ - PhoneNumber.prototype.e164Number = null; - - /** - * PhoneNumber shortCode. - * @member {google.type.PhoneNumber.IShortCode|null|undefined} shortCode - * @memberof google.type.PhoneNumber - * @instance - */ - PhoneNumber.prototype.shortCode = null; - - /** - * PhoneNumber extension. - * @member {string} extension - * @memberof google.type.PhoneNumber - * @instance - */ - PhoneNumber.prototype.extension = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PhoneNumber kind. - * @member {"e164Number"|"shortCode"|undefined} kind - * @memberof google.type.PhoneNumber - * @instance - */ - Object.defineProperty(PhoneNumber.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["e164Number", "shortCode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PhoneNumber instance using the specified properties. - * @function create - * @memberof google.type.PhoneNumber - * @static - * @param {google.type.IPhoneNumber=} [properties] Properties to set - * @returns {google.type.PhoneNumber} PhoneNumber instance - */ - PhoneNumber.create = function create(properties) { - return new PhoneNumber(properties); - }; - - /** - * Encodes the specified PhoneNumber message. Does not implicitly {@link google.type.PhoneNumber.verify|verify} messages. - * @function encode - * @memberof google.type.PhoneNumber - * @static - * @param {google.type.IPhoneNumber} message PhoneNumber message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhoneNumber.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.e164Number != null && Object.hasOwnProperty.call(message, "e164Number")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.e164Number); - if (message.shortCode != null && Object.hasOwnProperty.call(message, "shortCode")) - $root.google.type.PhoneNumber.ShortCode.encode(message.shortCode, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.extension); - return writer; - }; - - /** - * Encodes the specified PhoneNumber message, length delimited. Does not implicitly {@link google.type.PhoneNumber.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.PhoneNumber - * @static - * @param {google.type.IPhoneNumber} message PhoneNumber message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhoneNumber.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhoneNumber message from the specified reader or buffer. - * @function decode - * @memberof google.type.PhoneNumber - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.PhoneNumber} PhoneNumber - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhoneNumber.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.type.PhoneNumber(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.e164Number = reader.string(); - break; - } - case 2: { - message.shortCode = $root.google.type.PhoneNumber.ShortCode.decode(reader, reader.uint32()); - break; - } - case 3: { - message.extension = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PhoneNumber message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.PhoneNumber - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.PhoneNumber} PhoneNumber - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhoneNumber.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhoneNumber message. - * @function verify - * @memberof google.type.PhoneNumber - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhoneNumber.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.e164Number != null && message.hasOwnProperty("e164Number")) { - properties.kind = 1; - if (!$util.isString(message.e164Number)) - return "e164Number: string expected"; - } - if (message.shortCode != null && message.hasOwnProperty("shortCode")) { - if (properties.kind === 1) - return "kind: multiple values"; - properties.kind = 1; - { - var error = $root.google.type.PhoneNumber.ShortCode.verify(message.shortCode); - if (error) - return "shortCode." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) - if (!$util.isString(message.extension)) - return "extension: string expected"; - return null; - }; - - /** - * Creates a PhoneNumber message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.PhoneNumber - * @static - * @param {Object.} object Plain object - * @returns {google.type.PhoneNumber} PhoneNumber - */ - PhoneNumber.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.PhoneNumber) - return object; - var message = new $root.google.type.PhoneNumber(); - if (object.e164Number != null) - message.e164Number = String(object.e164Number); - if (object.shortCode != null) { - if (typeof object.shortCode !== "object") - throw TypeError(".google.type.PhoneNumber.shortCode: object expected"); - message.shortCode = $root.google.type.PhoneNumber.ShortCode.fromObject(object.shortCode); - } - if (object.extension != null) - message.extension = String(object.extension); - return message; - }; - - /** - * Creates a plain object from a PhoneNumber message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.PhoneNumber - * @static - * @param {google.type.PhoneNumber} message PhoneNumber - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhoneNumber.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.extension = ""; - if (message.e164Number != null && message.hasOwnProperty("e164Number")) { - object.e164Number = message.e164Number; - if (options.oneofs) - object.kind = "e164Number"; - } - if (message.shortCode != null && message.hasOwnProperty("shortCode")) { - object.shortCode = $root.google.type.PhoneNumber.ShortCode.toObject(message.shortCode, options); - if (options.oneofs) - object.kind = "shortCode"; - } - if (message.extension != null && message.hasOwnProperty("extension")) - object.extension = message.extension; - return object; - }; - - /** - * Converts this PhoneNumber to JSON. - * @function toJSON - * @memberof google.type.PhoneNumber - * @instance - * @returns {Object.} JSON object - */ - PhoneNumber.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhoneNumber - * @function getTypeUrl - * @memberof google.type.PhoneNumber - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhoneNumber.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.PhoneNumber"; - }; - - PhoneNumber.ShortCode = (function() { - - /** - * Properties of a ShortCode. - * @memberof google.type.PhoneNumber - * @interface IShortCode - * @property {string|null} [regionCode] ShortCode regionCode - * @property {string|null} [number] ShortCode number - */ - - /** - * Constructs a new ShortCode. - * @memberof google.type.PhoneNumber - * @classdesc Represents a ShortCode. - * @implements IShortCode - * @constructor - * @param {google.type.PhoneNumber.IShortCode=} [properties] Properties to set - */ - function ShortCode(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]]; - } - - /** - * ShortCode regionCode. - * @member {string} regionCode - * @memberof google.type.PhoneNumber.ShortCode - * @instance - */ - ShortCode.prototype.regionCode = ""; - - /** - * ShortCode number. - * @member {string} number - * @memberof google.type.PhoneNumber.ShortCode - * @instance - */ - ShortCode.prototype.number = ""; - - /** - * Creates a new ShortCode instance using the specified properties. - * @function create - * @memberof google.type.PhoneNumber.ShortCode - * @static - * @param {google.type.PhoneNumber.IShortCode=} [properties] Properties to set - * @returns {google.type.PhoneNumber.ShortCode} ShortCode instance - */ - ShortCode.create = function create(properties) { - return new ShortCode(properties); - }; - - /** - * Encodes the specified ShortCode message. Does not implicitly {@link google.type.PhoneNumber.ShortCode.verify|verify} messages. - * @function encode - * @memberof google.type.PhoneNumber.ShortCode - * @static - * @param {google.type.PhoneNumber.IShortCode} message ShortCode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShortCode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.regionCode); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.number); - return writer; - }; - - /** - * Encodes the specified ShortCode message, length delimited. Does not implicitly {@link google.type.PhoneNumber.ShortCode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.PhoneNumber.ShortCode - * @static - * @param {google.type.PhoneNumber.IShortCode} message ShortCode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShortCode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShortCode message from the specified reader or buffer. - * @function decode - * @memberof google.type.PhoneNumber.ShortCode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.PhoneNumber.ShortCode} ShortCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShortCode.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.type.PhoneNumber.ShortCode(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.regionCode = reader.string(); - break; - } - case 2: { - message.number = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShortCode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.PhoneNumber.ShortCode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.PhoneNumber.ShortCode} ShortCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShortCode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShortCode message. - * @function verify - * @memberof google.type.PhoneNumber.ShortCode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShortCode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isString(message.number)) - return "number: string expected"; - return null; - }; - - /** - * Creates a ShortCode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.PhoneNumber.ShortCode - * @static - * @param {Object.} object Plain object - * @returns {google.type.PhoneNumber.ShortCode} ShortCode - */ - ShortCode.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.PhoneNumber.ShortCode) - return object; - var message = new $root.google.type.PhoneNumber.ShortCode(); - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - if (object.number != null) - message.number = String(object.number); - return message; - }; - - /** - * Creates a plain object from a ShortCode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.PhoneNumber.ShortCode - * @static - * @param {google.type.PhoneNumber.ShortCode} message ShortCode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShortCode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.regionCode = ""; - object.number = ""; - } - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - return object; - }; - - /** - * Converts this ShortCode to JSON. - * @function toJSON - * @memberof google.type.PhoneNumber.ShortCode - * @instance - * @returns {Object.} JSON object - */ - ShortCode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShortCode - * @function getTypeUrl - * @memberof google.type.PhoneNumber.ShortCode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShortCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.PhoneNumber.ShortCode"; - }; - - return ShortCode; - })(); - - return PhoneNumber; - })(); - - type.PostalAddress = (function() { - - /** - * Properties of a PostalAddress. - * @memberof google.type - * @interface IPostalAddress - * @property {number|null} [revision] PostalAddress revision - * @property {string|null} [regionCode] PostalAddress regionCode - * @property {string|null} [languageCode] PostalAddress languageCode - * @property {string|null} [postalCode] PostalAddress postalCode - * @property {string|null} [sortingCode] PostalAddress sortingCode - * @property {string|null} [administrativeArea] PostalAddress administrativeArea - * @property {string|null} [locality] PostalAddress locality - * @property {string|null} [sublocality] PostalAddress sublocality - * @property {Array.|null} [addressLines] PostalAddress addressLines - * @property {Array.|null} [recipients] PostalAddress recipients - * @property {string|null} [organization] PostalAddress organization - */ - - /** - * Constructs a new PostalAddress. - * @memberof google.type - * @classdesc Represents a PostalAddress. - * @implements IPostalAddress - * @constructor - * @param {google.type.IPostalAddress=} [properties] Properties to set - */ - function PostalAddress(properties) { - this.addressLines = []; - this.recipients = []; - 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]]; - } - - /** - * PostalAddress revision. - * @member {number} revision - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.revision = 0; - - /** - * PostalAddress regionCode. - * @member {string} regionCode - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.regionCode = ""; - - /** - * PostalAddress languageCode. - * @member {string} languageCode - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.languageCode = ""; - - /** - * PostalAddress postalCode. - * @member {string} postalCode - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.postalCode = ""; - - /** - * PostalAddress sortingCode. - * @member {string} sortingCode - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.sortingCode = ""; - - /** - * PostalAddress administrativeArea. - * @member {string} administrativeArea - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.administrativeArea = ""; - - /** - * PostalAddress locality. - * @member {string} locality - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.locality = ""; - - /** - * PostalAddress sublocality. - * @member {string} sublocality - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.sublocality = ""; - - /** - * PostalAddress addressLines. - * @member {Array.} addressLines - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.addressLines = $util.emptyArray; - - /** - * PostalAddress recipients. - * @member {Array.} recipients - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.recipients = $util.emptyArray; - - /** - * PostalAddress organization. - * @member {string} organization - * @memberof google.type.PostalAddress - * @instance - */ - PostalAddress.prototype.organization = ""; - - /** - * Creates a new PostalAddress instance using the specified properties. - * @function create - * @memberof google.type.PostalAddress - * @static - * @param {google.type.IPostalAddress=} [properties] Properties to set - * @returns {google.type.PostalAddress} PostalAddress instance - */ - PostalAddress.create = function create(properties) { - return new PostalAddress(properties); - }; - - /** - * Encodes the specified PostalAddress message. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. - * @function encode - * @memberof google.type.PostalAddress - * @static - * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PostalAddress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revision); - if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.regionCode); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - if (message.postalCode != null && Object.hasOwnProperty.call(message, "postalCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.postalCode); - if (message.sortingCode != null && Object.hasOwnProperty.call(message, "sortingCode")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.sortingCode); - if (message.administrativeArea != null && Object.hasOwnProperty.call(message, "administrativeArea")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.administrativeArea); - if (message.locality != null && Object.hasOwnProperty.call(message, "locality")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.locality); - if (message.sublocality != null && Object.hasOwnProperty.call(message, "sublocality")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.sublocality); - if (message.addressLines != null && message.addressLines.length) - for (var i = 0; i < message.addressLines.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.addressLines[i]); - if (message.recipients != null && message.recipients.length) - for (var i = 0; i < message.recipients.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.recipients[i]); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.organization); - return writer; - }; - - /** - * Encodes the specified PostalAddress message, length delimited. Does not implicitly {@link google.type.PostalAddress.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.PostalAddress - * @static - * @param {google.type.IPostalAddress} message PostalAddress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PostalAddress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PostalAddress message from the specified reader or buffer. - * @function decode - * @memberof google.type.PostalAddress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.PostalAddress} PostalAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PostalAddress.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.type.PostalAddress(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.revision = reader.int32(); - break; - } - case 2: { - message.regionCode = reader.string(); - break; - } - case 3: { - message.languageCode = reader.string(); - break; - } - case 4: { - message.postalCode = reader.string(); - break; - } - case 5: { - message.sortingCode = reader.string(); - break; - } - case 6: { - message.administrativeArea = reader.string(); - break; - } - case 7: { - message.locality = reader.string(); - break; - } - case 8: { - message.sublocality = reader.string(); - break; - } - case 9: { - if (!(message.addressLines && message.addressLines.length)) - message.addressLines = []; - message.addressLines.push(reader.string()); - break; - } - case 10: { - if (!(message.recipients && message.recipients.length)) - message.recipients = []; - message.recipients.push(reader.string()); - break; - } - case 11: { - message.organization = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PostalAddress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.PostalAddress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.PostalAddress} PostalAddress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PostalAddress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PostalAddress message. - * @function verify - * @memberof google.type.PostalAddress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PostalAddress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isInteger(message.revision)) - return "revision: integer expected"; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - if (!$util.isString(message.regionCode)) - return "regionCode: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.postalCode != null && message.hasOwnProperty("postalCode")) - if (!$util.isString(message.postalCode)) - return "postalCode: string expected"; - if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) - if (!$util.isString(message.sortingCode)) - return "sortingCode: string expected"; - if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) - if (!$util.isString(message.administrativeArea)) - return "administrativeArea: string expected"; - if (message.locality != null && message.hasOwnProperty("locality")) - if (!$util.isString(message.locality)) - return "locality: string expected"; - if (message.sublocality != null && message.hasOwnProperty("sublocality")) - if (!$util.isString(message.sublocality)) - return "sublocality: string expected"; - if (message.addressLines != null && message.hasOwnProperty("addressLines")) { - if (!Array.isArray(message.addressLines)) - return "addressLines: array expected"; - for (var i = 0; i < message.addressLines.length; ++i) - if (!$util.isString(message.addressLines[i])) - return "addressLines: string[] expected"; - } - if (message.recipients != null && message.hasOwnProperty("recipients")) { - if (!Array.isArray(message.recipients)) - return "recipients: array expected"; - for (var i = 0; i < message.recipients.length; ++i) - if (!$util.isString(message.recipients[i])) - return "recipients: string[] expected"; - } - if (message.organization != null && message.hasOwnProperty("organization")) - if (!$util.isString(message.organization)) - return "organization: string expected"; - return null; - }; - - /** - * Creates a PostalAddress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.PostalAddress - * @static - * @param {Object.} object Plain object - * @returns {google.type.PostalAddress} PostalAddress - */ - PostalAddress.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.PostalAddress) - return object; - var message = new $root.google.type.PostalAddress(); - if (object.revision != null) - message.revision = object.revision | 0; - if (object.regionCode != null) - message.regionCode = String(object.regionCode); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.postalCode != null) - message.postalCode = String(object.postalCode); - if (object.sortingCode != null) - message.sortingCode = String(object.sortingCode); - if (object.administrativeArea != null) - message.administrativeArea = String(object.administrativeArea); - if (object.locality != null) - message.locality = String(object.locality); - if (object.sublocality != null) - message.sublocality = String(object.sublocality); - if (object.addressLines) { - if (!Array.isArray(object.addressLines)) - throw TypeError(".google.type.PostalAddress.addressLines: array expected"); - message.addressLines = []; - for (var i = 0; i < object.addressLines.length; ++i) - message.addressLines[i] = String(object.addressLines[i]); - } - if (object.recipients) { - if (!Array.isArray(object.recipients)) - throw TypeError(".google.type.PostalAddress.recipients: array expected"); - message.recipients = []; - for (var i = 0; i < object.recipients.length; ++i) - message.recipients[i] = String(object.recipients[i]); - } - if (object.organization != null) - message.organization = String(object.organization); - return message; - }; - - /** - * Creates a plain object from a PostalAddress message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.PostalAddress - * @static - * @param {google.type.PostalAddress} message PostalAddress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PostalAddress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.addressLines = []; - object.recipients = []; - } - if (options.defaults) { - object.revision = 0; - object.regionCode = ""; - object.languageCode = ""; - object.postalCode = ""; - object.sortingCode = ""; - object.administrativeArea = ""; - object.locality = ""; - object.sublocality = ""; - object.organization = ""; - } - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.regionCode != null && message.hasOwnProperty("regionCode")) - object.regionCode = message.regionCode; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.postalCode != null && message.hasOwnProperty("postalCode")) - object.postalCode = message.postalCode; - if (message.sortingCode != null && message.hasOwnProperty("sortingCode")) - object.sortingCode = message.sortingCode; - if (message.administrativeArea != null && message.hasOwnProperty("administrativeArea")) - object.administrativeArea = message.administrativeArea; - if (message.locality != null && message.hasOwnProperty("locality")) - object.locality = message.locality; - if (message.sublocality != null && message.hasOwnProperty("sublocality")) - object.sublocality = message.sublocality; - if (message.addressLines && message.addressLines.length) { - object.addressLines = []; - for (var j = 0; j < message.addressLines.length; ++j) - object.addressLines[j] = message.addressLines[j]; - } - if (message.recipients && message.recipients.length) { - object.recipients = []; - for (var j = 0; j < message.recipients.length; ++j) - object.recipients[j] = message.recipients[j]; - } - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = message.organization; - return object; - }; - - /** - * Converts this PostalAddress to JSON. - * @function toJSON - * @memberof google.type.PostalAddress - * @instance - * @returns {Object.} JSON object - */ - PostalAddress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PostalAddress - * @function getTypeUrl - * @memberof google.type.PostalAddress - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PostalAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.PostalAddress"; - }; - - return PostalAddress; - })(); - - type.Date = (function() { - - /** - * Properties of a Date. - * @memberof google.type - * @interface IDate - * @property {number|null} [year] Date year - * @property {number|null} [month] Date month - * @property {number|null} [day] Date day - */ - - /** - * Constructs a new Date. - * @memberof google.type - * @classdesc Represents a Date. - * @implements IDate - * @constructor - * @param {google.type.IDate=} [properties] Properties to set - */ - function Date(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]]; - } - - /** - * Date year. - * @member {number} year - * @memberof google.type.Date - * @instance - */ - Date.prototype.year = 0; - - /** - * Date month. - * @member {number} month - * @memberof google.type.Date - * @instance - */ - Date.prototype.month = 0; - - /** - * Date day. - * @member {number} day - * @memberof google.type.Date - * @instance - */ - Date.prototype.day = 0; - - /** - * Creates a new Date instance using the specified properties. - * @function create - * @memberof google.type.Date - * @static - * @param {google.type.IDate=} [properties] Properties to set - * @returns {google.type.Date} Date instance - */ - Date.create = function create(properties) { - return new Date(properties); - }; - - /** - * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @function encode - * @memberof google.type.Date - * @static - * @param {google.type.IDate} message Date message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Date.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.year != null && Object.hasOwnProperty.call(message, "year")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); - if (message.month != null && Object.hasOwnProperty.call(message, "month")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); - if (message.day != null && Object.hasOwnProperty.call(message, "day")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); - return writer; - }; - - /** - * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Date - * @static - * @param {google.type.IDate} message Date message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Date.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Date message from the specified reader or buffer. - * @function decode - * @memberof google.type.Date - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Date} Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Date.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.type.Date(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.year = reader.int32(); - break; - } - case 2: { - message.month = reader.int32(); - break; - } - case 3: { - message.day = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Date message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Date - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Date} Date - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Date.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Date message. - * @function verify - * @memberof google.type.Date - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Date.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.year != null && message.hasOwnProperty("year")) - if (!$util.isInteger(message.year)) - return "year: integer expected"; - if (message.month != null && message.hasOwnProperty("month")) - if (!$util.isInteger(message.month)) - return "month: integer expected"; - if (message.day != null && message.hasOwnProperty("day")) - if (!$util.isInteger(message.day)) - return "day: integer expected"; - return null; - }; - - /** - * Creates a Date message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Date - * @static - * @param {Object.} object Plain object - * @returns {google.type.Date} Date - */ - Date.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Date) - return object; - var message = new $root.google.type.Date(); - if (object.year != null) - message.year = object.year | 0; - if (object.month != null) - message.month = object.month | 0; - if (object.day != null) - message.day = object.day | 0; - return message; - }; - - /** - * Creates a plain object from a Date message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Date - * @static - * @param {google.type.Date} message Date - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Date.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.year = 0; - object.month = 0; - object.day = 0; - } - if (message.year != null && message.hasOwnProperty("year")) - object.year = message.year; - if (message.month != null && message.hasOwnProperty("month")) - object.month = message.month; - if (message.day != null && message.hasOwnProperty("day")) - object.day = message.day; - return object; - }; - - /** - * Converts this Date to JSON. - * @function toJSON - * @memberof google.type.Date - * @instance - * @returns {Object.} JSON object - */ - Date.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Date - * @function getTypeUrl - * @memberof google.type.Date - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Date"; - }; - - return Date; - })(); - - return type; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.json deleted file mode 100644 index d91feea2e61..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/protos.json +++ /dev/null @@ -1,6551 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "shopping": { - "nested": { - "merchant": { - "nested": { - "accounts": { - "nested": { - "v1beta": { - "options": { - "go_package": "cloud.google.com/go/shopping/merchant/accounts/apiv1beta/accountspb;accountspb", - "java_multiple_files": true, - "java_outer_classname": "TermsOfServiceAgreementStateProto", - "java_package": "com.google.shopping.merchant.accounts.v1beta" - }, - "nested": { - "AccessRight": { - "values": { - "ACCESS_RIGHT_UNSPECIFIED": 0, - "STANDARD": 1, - "ADMIN": 2, - "PERFORMANCE_REPORTING": 3 - } - }, - "AccountTaxService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetAccountTax": { - "requestType": "GetAccountTaxRequest", - "responseType": "AccountTax", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/accounttax/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/accounttax/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListAccountTax": { - "requestType": "ListAccountTaxRequest", - "responseType": "ListAccountTaxResponse", - "options": { - "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/accounttax", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{parent=accounts/*}/accounttax" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "UpdateAccountTax": { - "requestType": "UpdateAccountTaxRequest", - "responseType": "AccountTax", - "options": { - "(google.api.http).patch": "/accounts/v1beta/{account_tax.name=accounts/*/accounttax/*}", - "(google.api.http).body": "account_tax", - "(google.api.method_signature)": "account_tax" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/accounts/v1beta/{account_tax.name=accounts/*/accounttax/*}", - "body": "account_tax" - } - }, - { - "(google.api.method_signature)": "account_tax,update_mask" - }, - { - "(google.api.method_signature)": "account_tax" - } - ] - } - } - }, - "AccountTax": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/AccountTax", - "(google.api.resource).pattern": "accounts/{account}/accounttax/{tax}", - "(google.api.resource).plural": "accountTaxes", - "(google.api.resource).singular": "accountTax" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "account": { - "type": "int64", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "taxRules": { - "rule": "repeated", - "type": "TaxRule", - "id": 3 - } - } - }, - "GetAccountTaxRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/AccountTax" - } - } - } - }, - "UpdateAccountTaxRequest": { - "fields": { - "accountTax": { - "type": "AccountTax", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "ListAccountTaxRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "merchantapi.googleapis.com/AccountTax" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListAccountTaxResponse": { - "fields": { - "accountTaxes": { - "rule": "repeated", - "type": "AccountTax", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "TaxRule": { - "oneofs": { - "location": { - "oneof": [ - "locationId", - "postCodeRange" - ] - }, - "rateCalculation": { - "oneof": [ - "useGoogleRate", - "selfSpecifiedRateMicros" - ] - } - }, - "fields": { - "locationId": { - "type": "int64", - "id": 2 - }, - "postCodeRange": { - "type": "TaxPostalCodeRange", - "id": 3 - }, - "useGoogleRate": { - "type": "bool", - "id": 4 - }, - "selfSpecifiedRateMicros": { - "type": "int64", - "id": 5 - }, - "regionCode": { - "type": "string", - "id": 1 - }, - "shippingTaxed": { - "type": "bool", - "id": 6 - }, - "effectiveTimePeriod": { - "type": "google.type.Interval", - "id": 7, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "TaxPostalCodeRange": { - "fields": { - "start": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "end": { - "type": "string", - "id": 2 - } - } - } - } - }, - "AccountIssueService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "ListAccountIssues": { - "requestType": "ListAccountIssuesRequest", - "responseType": "ListAccountIssuesResponse", - "options": { - "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/issues", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{parent=accounts/*}/issues" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "AccountIssue": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/AccountIssue", - "(google.api.resource).pattern": "accounts/{account}/issues/{issue}", - "(google.api.resource).plural": "accountIssues", - "(google.api.resource).singular": "accountIssue" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "title": { - "type": "string", - "id": 2 - }, - "severity": { - "type": "Severity", - "id": 3 - }, - "impactedDestinations": { - "rule": "repeated", - "type": "ImpactedDestination", - "id": 4 - }, - "detail": { - "type": "string", - "id": 5 - }, - "documentationUri": { - "type": "string", - "id": 6 - } - }, - "nested": { - "ImpactedDestination": { - "oneofs": { - "_reportingContext": { - "oneof": [ - "reportingContext" - ] - } - }, - "fields": { - "reportingContext": { - "type": "google.shopping.type.ReportingContext.ReportingContextEnum", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "impacts": { - "rule": "repeated", - "type": "Impact", - "id": 2 - } - }, - "nested": { - "Impact": { - "fields": { - "regionCode": { - "type": "string", - "id": 1 - }, - "severity": { - "type": "Severity", - "id": 2 - } - } - } - } - }, - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "CRITICAL": 1, - "ERROR": 2, - "SUGGESTION": 3 - } - } - } - }, - "ListAccountIssuesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "languageCode": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "timeZone": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListAccountIssuesResponse": { - "fields": { - "accountIssues": { - "rule": "repeated", - "type": "AccountIssue", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "AccountsService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetAccount": { - "requestType": "GetAccountRequest", - "responseType": "Account", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateAndConfigureAccount": { - "requestType": "CreateAndConfigureAccountRequest", - "responseType": "Account", - "options": { - "(google.api.http).post": "/accounts/v1beta/accounts:createAndConfigure", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/accounts/v1beta/accounts:createAndConfigure", - "body": "*" - } - } - ] - }, - "DeleteAccount": { - "requestType": "DeleteAccountRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/accounts/v1beta/{name=accounts/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/accounts/v1beta/{name=accounts/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateAccount": { - "requestType": "UpdateAccountRequest", - "responseType": "Account", - "options": { - "(google.api.http).patch": "/accounts/v1beta/{account.name=accounts/*}", - "(google.api.http).body": "account", - "(google.api.method_signature)": "account,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/accounts/v1beta/{account.name=accounts/*}", - "body": "account" - } - }, - { - "(google.api.method_signature)": "account,update_mask" - } - ] - }, - "ListAccounts": { - "requestType": "ListAccountsRequest", - "responseType": "ListAccountsResponse", - "options": { - "(google.api.http).get": "/accounts/v1beta/accounts" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/accounts" - } - } - ] - }, - "ListSubAccounts": { - "requestType": "ListSubAccountsRequest", - "responseType": "ListSubAccountsResponse", - "options": { - "(google.api.http).get": "/accounts/v1beta/{provider=accounts/*}:listSubaccounts", - "(google.api.method_signature)": "provider" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{provider=accounts/*}:listSubaccounts" - } - }, - { - "(google.api.method_signature)": "provider" - } - ] - } - } - }, - "Account": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/Account", - "(google.api.resource).pattern": "accounts/{account}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "accountId": { - "type": "int64", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "accountName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "adultContent": { - "type": "bool", - "id": 4 - }, - "testAccount": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "timeZone": { - "type": "google.type.TimeZone", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "languageCode": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetAccountRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - } - } - }, - "CreateAndConfigureAccountRequest": { - "oneofs": { - "_acceptTermsOfService": { - "oneof": [ - "acceptTermsOfService" - ] - } - }, - "fields": { - "account": { - "type": "Account", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "users": { - "rule": "repeated", - "type": "CreateUserRequest", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "acceptTermsOfService": { - "type": "AcceptTermsOfService", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "service": { - "rule": "repeated", - "type": "AddAccountService", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "AcceptTermsOfService": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" - } - }, - "regionCode": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AddAccountService": { - "oneofs": { - "serviceType": { - "oneof": [ - "accountAggregation" - ] - }, - "_provider": { - "oneof": [ - "provider" - ] - } - }, - "fields": { - "accountAggregation": { - "type": "AccountAggregation", - "id": 103 - }, - "provider": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account", - "proto3_optional": true - } - } - } - } - } - }, - "DeleteAccountRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - } - } - }, - "UpdateAccountRequest": { - "fields": { - "account": { - "type": "Account", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListAccountsRequest": { - "fields": { - "pageSize": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListAccountsResponse": { - "fields": { - "accounts": { - "rule": "repeated", - "type": "Account", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListSubAccountsRequest": { - "fields": { - "provider": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSubAccountsResponse": { - "fields": { - "accounts": { - "rule": "repeated", - "type": "Account", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "AccountAggregation": { - "fields": {} - }, - "UserService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetUser": { - "requestType": "GetUserRequest", - "responseType": "User", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateUser": { - "requestType": "CreateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).post": "/accounts/v1beta/{parent=accounts/*}/users", - "(google.api.http).body": "user", - "(google.api.method_signature)": "parent,user" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/accounts/v1beta/{parent=accounts/*}/users", - "body": "user" - } - }, - { - "(google.api.method_signature)": "parent,user" - } - ] - }, - "DeleteUser": { - "requestType": "DeleteUserRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/accounts/v1beta/{name=accounts/*/users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/accounts/v1beta/{name=accounts/*/users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateUser": { - "requestType": "UpdateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).patch": "/accounts/v1beta/{user.name=accounts/*/users/*}", - "(google.api.http).body": "user", - "(google.api.method_signature)": "user,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/accounts/v1beta/{user.name=accounts/*/users/*}", - "body": "user" - } - }, - { - "(google.api.method_signature)": "user,update_mask" - } - ] - }, - "ListUsers": { - "requestType": "ListUsersRequest", - "responseType": "ListUsersResponse", - "options": { - "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/users", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{parent=accounts/*}/users" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "User": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/User", - "(google.api.resource).pattern": "accounts/{account}/users/{email}", - "(google.api.resource).plural": "users", - "(google.api.resource).singular": "user" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "state": { - "type": "State", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "accessRights": { - "rule": "repeated", - "type": "AccessRight", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING": 1, - "VERIFIED": 2 - } - } - } - }, - "GetUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/User" - } - } - } - }, - "CreateUserRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - }, - "userId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "user": { - "type": "User", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/User" - } - } - } - }, - "UpdateUserRequest": { - "fields": { - "user": { - "type": "User", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListUsersRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListUsersResponse": { - "fields": { - "users": { - "rule": "repeated", - "type": "User", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "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", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetBusinessIdentity": { - "requestType": "GetBusinessIdentityRequest", - "responseType": "BusinessIdentity", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/businessIdentity}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/businessIdentity}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateBusinessIdentity": { - "requestType": "UpdateBusinessIdentityRequest", - "responseType": "BusinessIdentity", - "options": { - "(google.api.http).patch": "/accounts/v1beta/{business_identity.name=accounts/*/businessIdentity}", - "(google.api.http).body": "business_identity", - "(google.api.method_signature)": "business_identity,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/accounts/v1beta/{business_identity.name=accounts/*/businessIdentity}", - "body": "business_identity" - } - }, - { - "(google.api.method_signature)": "business_identity,update_mask" - } - ] - } - } - }, - "BusinessIdentity": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/BusinessIdentity", - "(google.api.resource).pattern": "accounts/{account}/businessIdentity", - "(google.api.resource).plural": "businessIdentities", - "(google.api.resource).singular": "businessIdentity" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "promotionsConsent": { - "type": "PromotionsConsent", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "blackOwned": { - "type": "IdentityAttribute", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "womenOwned": { - "type": "IdentityAttribute", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "veteranOwned": { - "type": "IdentityAttribute", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "latinoOwned": { - "type": "IdentityAttribute", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "smallBusiness": { - "type": "IdentityAttribute", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "IdentityAttribute": { - "fields": { - "identityDeclaration": { - "type": "IdentityDeclaration", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "IdentityDeclaration": { - "values": { - "IDENTITY_DECLARATION_UNSPECIFIED": 0, - "SELF_IDENTIFIES_AS": 1, - "DOES_NOT_SELF_IDENTIFY_AS": 2 - } - } - } - }, - "PromotionsConsent": { - "values": { - "PROMOTIONS_CONSENT_UNSPECIFIED": 0, - "PROMOTIONS_CONSENT_GIVEN": 1, - "PROMOTIONS_CONSENT_DENIED": 2 - } - } - } - }, - "GetBusinessIdentityRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/BusinessIdentity" - } - } - } - }, - "UpdateBusinessIdentityRequest": { - "fields": { - "businessIdentity": { - "type": "BusinessIdentity", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BusinessInfoService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetBusinessInfo": { - "requestType": "GetBusinessInfoRequest", - "responseType": "BusinessInfo", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/businessInfo}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/businessInfo}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateBusinessInfo": { - "requestType": "UpdateBusinessInfoRequest", - "responseType": "BusinessInfo", - "options": { - "(google.api.http).patch": "/accounts/v1beta/{business_info.name=accounts/*/businessInfo}", - "(google.api.http).body": "business_info", - "(google.api.method_signature)": "business_info,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/accounts/v1beta/{business_info.name=accounts/*/businessInfo}", - "body": "business_info" - } - }, - { - "(google.api.method_signature)": "business_info,update_mask" - } - ] - } - } - }, - "BusinessInfo": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/BusinessInfo", - "(google.api.resource).pattern": "accounts/{account}/businessInfo", - "(google.api.resource).plural": "businessInfos", - "(google.api.resource).singular": "businessInfo" - }, - "oneofs": { - "_address": { - "oneof": [ - "address" - ] - }, - "_phone": { - "oneof": [ - "phone" - ] - }, - "_phoneVerificationState": { - "oneof": [ - "phoneVerificationState" - ] - }, - "_customerService": { - "oneof": [ - "customerService" - ] - }, - "_koreanBusinessRegistrationNumber": { - "oneof": [ - "koreanBusinessRegistrationNumber" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "address": { - "type": "google.type.PostalAddress", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "phone": { - "type": "google.type.PhoneNumber", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "phoneVerificationState": { - "type": "PhoneVerificationState", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "customerService": { - "type": "CustomerService", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "koreanBusinessRegistrationNumber": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "GetBusinessInfoRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/BusinessInfo" - } - } - } - }, - "UpdateBusinessInfoRequest": { - "fields": { - "businessInfo": { - "type": "BusinessInfo", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "CustomerService": { - "oneofs": { - "_uri": { - "oneof": [ - "uri" - ] - }, - "_email": { - "oneof": [ - "email" - ] - }, - "_phone": { - "oneof": [ - "phone" - ] - } - }, - "fields": { - "uri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "email": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "phone": { - "type": "google.type.PhoneNumber", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "PhoneVerificationState": { - "values": { - "PHONE_VERIFICATION_STATE_UNSPECIFIED": 0, - "PHONE_VERIFICATION_STATE_VERIFIED": 1, - "PHONE_VERIFICATION_STATE_UNVERIFIED": 2 - } - }, - "EmailPreferencesService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetEmailPreferences": { - "requestType": "GetEmailPreferencesRequest", - "responseType": "EmailPreferences", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/users/*/emailPreferences}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/users/*/emailPreferences}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateEmailPreferences": { - "requestType": "UpdateEmailPreferencesRequest", - "responseType": "EmailPreferences", - "options": { - "(google.api.http).patch": "/accounts/v1beta/{email_preferences.name=accounts/*/users/*/emailPreferences}", - "(google.api.http).body": "email_preferences", - "(google.api.method_signature)": "email_preferences,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/accounts/v1beta/{email_preferences.name=accounts/*/users/*/emailPreferences}", - "body": "email_preferences" - } - }, - { - "(google.api.method_signature)": "email_preferences,update_mask" - } - ] - } - } - }, - "EmailPreferences": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/EmailPreferences", - "(google.api.resource).pattern": "accounts/{account}/users/{email}/emailPreferences", - "(google.api.resource).plural": "emailPreferences", - "(google.api.resource).singular": "emailPreferences" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "newsAndTips": { - "type": "OptInState", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "OptInState": { - "values": { - "OPT_IN_STATE_UNSPECIFIED": 0, - "OPTED_OUT": 1, - "OPTED_IN": 2, - "UNCONFIRMED": 3 - } - } - } - }, - "GetEmailPreferencesRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/EmailPreferences" - } - } - } - }, - "UpdateEmailPreferencesRequest": { - "fields": { - "emailPreferences": { - "type": "EmailPreferences", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "HomepageService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetHomepage": { - "requestType": "GetHomepageRequest", - "responseType": "Homepage", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/homepage}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/homepage}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateHomepage": { - "requestType": "UpdateHomepageRequest", - "responseType": "Homepage", - "options": { - "(google.api.http).patch": "/accounts/v1beta/{homepage.name=accounts/*/homepage}", - "(google.api.http).body": "homepage", - "(google.api.method_signature)": "homepage,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/accounts/v1beta/{homepage.name=accounts/*/homepage}", - "body": "homepage" - } - }, - { - "(google.api.method_signature)": "homepage,update_mask" - } - ] - }, - "ClaimHomepage": { - "requestType": "ClaimHomepageRequest", - "responseType": "Homepage", - "options": { - "(google.api.http).post": "/accounts/v1beta/{name=accounts/*/homepage}:claim", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/accounts/v1beta/{name=accounts/*/homepage}:claim", - "body": "*" - } - } - ] - }, - "UnclaimHomepage": { - "requestType": "UnclaimHomepageRequest", - "responseType": "Homepage", - "options": { - "(google.api.http).post": "/accounts/v1beta/{name=accounts/*/homepage}:unclaim", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/accounts/v1beta/{name=accounts/*/homepage}:unclaim", - "body": "*" - } - } - ] - } - } - }, - "Homepage": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/Homepage", - "(google.api.resource).pattern": "accounts/{account}/homepage", - "(google.api.resource).plural": "homepages", - "(google.api.resource).singular": "homepage" - }, - "oneofs": { - "_uri": { - "oneof": [ - "uri" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "uri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "claimed": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GetHomepageRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Homepage" - } - } - } - }, - "UpdateHomepageRequest": { - "fields": { - "homepage": { - "type": "Homepage", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ClaimHomepageRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Homepage" - } - } - } - }, - "UnclaimHomepageRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Homepage" - } - } - } - }, - "OnlineReturnPolicyService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetOnlineReturnPolicy": { - "requestType": "GetOnlineReturnPolicyRequest", - "responseType": "OnlineReturnPolicy", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/onlineReturnPolicies/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/onlineReturnPolicies/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListOnlineReturnPolicies": { - "requestType": "ListOnlineReturnPoliciesRequest", - "responseType": "ListOnlineReturnPoliciesResponse", - "options": { - "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/onlineReturnPolicies", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{parent=accounts/*}/onlineReturnPolicies" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "GetOnlineReturnPolicyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/OnlineReturnPolicy" - } - } - } - }, - "ListOnlineReturnPoliciesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "merchantapi.googleapis.com/OnlineReturnPolicy" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListOnlineReturnPoliciesResponse": { - "fields": { - "onlineReturnPolicies": { - "rule": "repeated", - "type": "OnlineReturnPolicy", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "OnlineReturnPolicy": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/OnlineReturnPolicy", - "(google.api.resource).pattern": "accounts/{account}/onlineReturnPolicies/{return_policy}", - "(google.api.resource).plural": "onlineReturnPolicies", - "(google.api.resource).singular": "onlineReturnPolicy" - }, - "oneofs": { - "_acceptDefectiveOnly": { - "oneof": [ - "acceptDefectiveOnly" - ] - }, - "_processRefundDays": { - "oneof": [ - "processRefundDays" - ] - }, - "_acceptExchange": { - "oneof": [ - "acceptExchange" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "returnPolicyId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "label": { - "type": "string", - "id": 3 - }, - "countries": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "policy": { - "type": "Policy", - "id": 5 - }, - "restockingFee": { - "type": "RestockingFee", - "id": 6 - }, - "returnMethods": { - "rule": "repeated", - "type": "ReturnMethod", - "id": 7 - }, - "itemConditions": { - "rule": "repeated", - "type": "ItemCondition", - "id": 8 - }, - "returnShippingFee": { - "type": "ReturnShippingFee", - "id": 9 - }, - "returnPolicyUri": { - "type": "string", - "id": 10 - }, - "acceptDefectiveOnly": { - "type": "bool", - "id": 11, - "options": { - "proto3_optional": true - } - }, - "processRefundDays": { - "type": "int32", - "id": 12, - "options": { - "proto3_optional": true - } - }, - "acceptExchange": { - "type": "bool", - "id": 13, - "options": { - "proto3_optional": true - } - } - }, - "nested": { - "ReturnShippingFee": { - "fields": { - "type": { - "type": "Type", - "id": 1 - }, - "fixedFee": { - "type": "google.shopping.type.Price", - "id": 2 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "FIXED": 1, - "CUSTOMER_PAYING_ACTUAL_FEE": 2 - } - } - } - }, - "RestockingFee": { - "oneofs": { - "type": { - "oneof": [ - "fixedFee", - "microPercent" - ] - } - }, - "fields": { - "fixedFee": { - "type": "google.shopping.type.Price", - "id": 1 - }, - "microPercent": { - "type": "int32", - "id": 2 - } - } - }, - "Policy": { - "fields": { - "type": { - "type": "Type", - "id": 1 - }, - "days": { - "type": "int64", - "id": 2 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "NUMBER_OF_DAYS_AFTER_DELIVERY": 1, - "NO_RETURNS": 2, - "LIFETIME_RETURNS": 3 - } - } - } - }, - "ReturnMethod": { - "values": { - "RETURN_METHOD_UNSPECIFIED": 0, - "BY_MAIL": 1, - "IN_STORE": 2, - "AT_A_KIOSK": 3 - } - }, - "ItemCondition": { - "values": { - "ITEM_CONDITION_UNSPECIFIED": 0, - "NEW": 1, - "USED": 2 - } - } - } - }, - "ProgramsService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetProgram": { - "requestType": "GetProgramRequest", - "responseType": "Program", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/programs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/programs/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListPrograms": { - "requestType": "ListProgramsRequest", - "responseType": "ListProgramsResponse", - "options": { - "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/programs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{parent=accounts/*}/programs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "EnableProgram": { - "requestType": "EnableProgramRequest", - "responseType": "Program", - "options": { - "(google.api.http).post": "/accounts/v1beta/{name=accounts/*/programs/*}:enable", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/accounts/v1beta/{name=accounts/*/programs/*}:enable", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DisableProgram": { - "requestType": "DisableProgramRequest", - "responseType": "Program", - "options": { - "(google.api.http).post": "/accounts/v1beta/{name=accounts/*/programs/*}:disable", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/accounts/v1beta/{name=accounts/*/programs/*}:disable", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "Program": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/Program", - "(google.api.resource).pattern": "accounts/{account}/programs/{program}", - "(google.api.resource).plural": "programs", - "(google.api.resource).singular": "program" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "documentationUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "activeRegionCodes": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "unmetRequirements": { - "rule": "repeated", - "type": "Requirement", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Requirement": { - "fields": { - "title": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "documentationUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "affectedRegionCodes": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "NOT_ELIGIBLE": 1, - "ELIGIBLE": 2, - "ENABLED": 3 - } - } - } - }, - "GetProgramRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Program" - } - } - } - }, - "ListProgramsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "merchantapi.googleapis.com/Program" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListProgramsResponse": { - "fields": { - "programs": { - "rule": "repeated", - "type": "Program", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "EnableProgramRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Program" - } - } - } - }, - "DisableProgramRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Program" - } - } - } - }, - "RegionsService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetRegion": { - "requestType": "GetRegionRequest", - "responseType": "Region", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/regions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/regions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateRegion": { - "requestType": "CreateRegionRequest", - "responseType": "Region", - "options": { - "(google.api.http).post": "/accounts/v1beta/{parent=accounts/*}/regions", - "(google.api.http).body": "region", - "(google.api.method_signature)": "parent,region,region_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/accounts/v1beta/{parent=accounts/*}/regions", - "body": "region" - } - }, - { - "(google.api.method_signature)": "parent,region,region_id" - } - ] - }, - "UpdateRegion": { - "requestType": "UpdateRegionRequest", - "responseType": "Region", - "options": { - "(google.api.http).patch": "/accounts/v1beta/{region.name=accounts/*/regions/*}", - "(google.api.http).body": "region", - "(google.api.method_signature)": "region,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/accounts/v1beta/{region.name=accounts/*/regions/*}", - "body": "region" - } - }, - { - "(google.api.method_signature)": "region,update_mask" - } - ] - }, - "DeleteRegion": { - "requestType": "DeleteRegionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/accounts/v1beta/{name=accounts/*/regions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/accounts/v1beta/{name=accounts/*/regions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListRegions": { - "requestType": "ListRegionsRequest", - "responseType": "ListRegionsResponse", - "options": { - "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/regions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{parent=accounts/*}/regions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "GetRegionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Region" - } - } - } - }, - "CreateRegionRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - }, - "regionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "Region", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateRegionRequest": { - "fields": { - "region": { - "type": "Region", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteRegionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Region" - } - } - } - }, - "ListRegionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListRegionsResponse": { - "fields": { - "regions": { - "rule": "repeated", - "type": "Region", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Region": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/Region", - "(google.api.resource).pattern": "accounts/{account}/regions/{region}", - "(google.api.resource).plural": "regions", - "(google.api.resource).singular": "region" - }, - "oneofs": { - "_displayName": { - "oneof": [ - "displayName" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "postalCodeArea": { - "type": "PostalCodeArea", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "geotargetArea": { - "type": "GeoTargetArea", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "regionalInventoryEligible": { - "type": "google.protobuf.BoolValue", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "shippingEligible": { - "type": "google.protobuf.BoolValue", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "PostalCodeArea": { - "fields": { - "regionCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "postalCodes": { - "rule": "repeated", - "type": "PostalCodeRange", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "PostalCodeRange": { - "fields": { - "begin": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "end": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "GeoTargetArea": { - "fields": { - "geotargetCriteriaIds": { - "rule": "repeated", - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "ShippingSettingsService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetShippingSettings": { - "requestType": "GetShippingSettingsRequest", - "responseType": "ShippingSettings", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/shippingSettings}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/shippingSettings}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "InsertShippingSettings": { - "requestType": "InsertShippingSettingsRequest", - "responseType": "ShippingSettings", - "options": { - "(google.api.http).post": "/accounts/v1beta/{parent=accounts/*}/shippingSettings:insert", - "(google.api.http).body": "shipping_setting" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/accounts/v1beta/{parent=accounts/*}/shippingSettings:insert", - "body": "shipping_setting" - } - } - ] - } - } - }, - "ShippingSettings": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/ShippingSettings", - "(google.api.resource).pattern": "accounts/{account}/shippingSettings", - "(google.api.resource).plural": "shippingSettings", - "(google.api.resource).singular": "shippingSettings" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "services": { - "rule": "repeated", - "type": "Service", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "warehouses": { - "rule": "repeated", - "type": "Warehouse", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Service": { - "oneofs": { - "_serviceName": { - "oneof": [ - "serviceName" - ] - }, - "_active": { - "oneof": [ - "active" - ] - }, - "_currencyCode": { - "oneof": [ - "currencyCode" - ] - }, - "_deliveryTime": { - "oneof": [ - "deliveryTime" - ] - }, - "_shipmentType": { - "oneof": [ - "shipmentType" - ] - }, - "_minimumOrderValue": { - "oneof": [ - "minimumOrderValue" - ] - }, - "_minimumOrderValueTable": { - "oneof": [ - "minimumOrderValueTable" - ] - }, - "_storeConfig": { - "oneof": [ - "storeConfig" - ] - } - }, - "fields": { - "serviceName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "active": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "deliveryCountries": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "currencyCode": { - "type": "string", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "deliveryTime": { - "type": "DeliveryTime", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "rateGroups": { - "rule": "repeated", - "type": "RateGroup", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "shipmentType": { - "type": "ShipmentType", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "minimumOrderValue": { - "type": "google.shopping.type.Price", - "id": 8, - "options": { - "proto3_optional": true - } - }, - "minimumOrderValueTable": { - "type": "MinimumOrderValueTable", - "id": 9, - "options": { - "proto3_optional": true - } - }, - "storeConfig": { - "type": "StoreConfig", - "id": 10, - "options": { - "proto3_optional": true - } - }, - "loyaltyPrograms": { - "rule": "repeated", - "type": "LoyaltyProgram", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "StoreConfig": { - "oneofs": { - "_storeServiceType": { - "oneof": [ - "storeServiceType" - ] - }, - "_cutoffConfig": { - "oneof": [ - "cutoffConfig" - ] - }, - "_serviceRadius": { - "oneof": [ - "serviceRadius" - ] - } - }, - "fields": { - "storeServiceType": { - "type": "StoreServiceType", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "storeCodes": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cutoffConfig": { - "type": "CutoffConfig", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "serviceRadius": { - "type": "Distance", - "id": 4, - "options": { - "proto3_optional": true - } - } - }, - "nested": { - "CutoffConfig": { - "oneofs": { - "_localCutoffTime": { - "oneof": [ - "localCutoffTime" - ] - }, - "_storeCloseOffsetHours": { - "oneof": [ - "storeCloseOffsetHours" - ] - }, - "_noDeliveryPostCutoff": { - "oneof": [ - "noDeliveryPostCutoff" - ] - } - }, - "fields": { - "localCutoffTime": { - "type": "LocalCutoffTime", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "storeCloseOffsetHours": { - "type": "int64", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "noDeliveryPostCutoff": { - "type": "bool", - "id": 3, - "options": { - "proto3_optional": true - } - } - }, - "nested": { - "LocalCutoffTime": { - "oneofs": { - "_hour": { - "oneof": [ - "hour" - ] - }, - "_minute": { - "oneof": [ - "minute" - ] - } - }, - "fields": { - "hour": { - "type": "int64", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "minute": { - "type": "int64", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - } - } - }, - "StoreServiceType": { - "values": { - "STORE_SERVICE_TYPE_UNSPECIFIED": 0, - "ALL_STORES": 1, - "SELECTED_STORES": 2 - } - } - } - }, - "LoyaltyProgram": { - "oneofs": { - "_programLabel": { - "oneof": [ - "programLabel" - ] - } - }, - "fields": { - "programLabel": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "loyaltyProgramTiers": { - "rule": "repeated", - "type": "LoyaltyProgramTiers", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LoyaltyProgramTiers": { - "oneofs": { - "_tierLabel": { - "oneof": [ - "tierLabel" - ] - } - }, - "fields": { - "tierLabel": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - } - } - } - } - }, - "ShipmentType": { - "values": { - "SHIPMENT_TYPE_UNSPECIFIED": 0, - "DELIVERY": 1, - "LOCAL_DELIVERY": 2, - "COLLECTION_POINT": 3 - } - } - } - }, - "Distance": { - "oneofs": { - "_value": { - "oneof": [ - "value" - ] - }, - "_unit": { - "oneof": [ - "unit" - ] - } - }, - "fields": { - "value": { - "type": "int64", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "unit": { - "type": "Unit", - "id": 2, - "options": { - "proto3_optional": true - } - } - }, - "nested": { - "Unit": { - "values": { - "UNIT_UNSPECIFIED": 0, - "MILES": 1, - "KILOMETERS": 2 - } - } - } - }, - "Warehouse": { - "oneofs": { - "_name": { - "oneof": [ - "name" - ] - }, - "_shippingAddress": { - "oneof": [ - "shippingAddress" - ] - }, - "_cutoffTime": { - "oneof": [ - "cutoffTime" - ] - }, - "_handlingDays": { - "oneof": [ - "handlingDays" - ] - }, - "_businessDayConfig": { - "oneof": [ - "businessDayConfig" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "shippingAddress": { - "type": "Address", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "cutoffTime": { - "type": "WarehouseCutoffTime", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "handlingDays": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "businessDayConfig": { - "type": "BusinessDayConfig", - "id": 5, - "options": { - "proto3_optional": true - } - } - } - }, - "WarehouseCutoffTime": { - "oneofs": { - "_hour": { - "oneof": [ - "hour" - ] - }, - "_minute": { - "oneof": [ - "minute" - ] - } - }, - "fields": { - "hour": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "minute": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - } - } - }, - "Address": { - "oneofs": { - "_streetAddress": { - "oneof": [ - "streetAddress" - ] - }, - "_city": { - "oneof": [ - "city" - ] - }, - "_administrativeArea": { - "oneof": [ - "administrativeArea" - ] - }, - "_postalCode": { - "oneof": [ - "postalCode" - ] - }, - "_regionCode": { - "oneof": [ - "regionCode" - ] - } - }, - "fields": { - "streetAddress": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "city": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "administrativeArea": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "postalCode": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "regionCode": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - } - } - }, - "DeliveryTime": { - "oneofs": { - "_minTransitDays": { - "oneof": [ - "minTransitDays" - ] - }, - "_maxTransitDays": { - "oneof": [ - "maxTransitDays" - ] - }, - "_cutoffTime": { - "oneof": [ - "cutoffTime" - ] - }, - "_minHandlingDays": { - "oneof": [ - "minHandlingDays" - ] - }, - "_maxHandlingDays": { - "oneof": [ - "maxHandlingDays" - ] - }, - "_transitTimeTable": { - "oneof": [ - "transitTimeTable" - ] - }, - "_handlingBusinessDayConfig": { - "oneof": [ - "handlingBusinessDayConfig" - ] - }, - "_transitBusinessDayConfig": { - "oneof": [ - "transitBusinessDayConfig" - ] - } - }, - "fields": { - "minTransitDays": { - "type": "int32", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "maxTransitDays": { - "type": "int32", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "cutoffTime": { - "type": "CutoffTime", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "minHandlingDays": { - "type": "int32", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "maxHandlingDays": { - "type": "int32", - "id": 5, - "options": { - "proto3_optional": true - } - }, - "transitTimeTable": { - "type": "TransitTable", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "handlingBusinessDayConfig": { - "type": "BusinessDayConfig", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "transitBusinessDayConfig": { - "type": "BusinessDayConfig", - "id": 8, - "options": { - "proto3_optional": true - } - }, - "warehouseBasedDeliveryTimes": { - "rule": "repeated", - "type": "WarehouseBasedDeliveryTime", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CutoffTime": { - "oneofs": { - "_hour": { - "oneof": [ - "hour" - ] - }, - "_minute": { - "oneof": [ - "minute" - ] - }, - "_timeZone": { - "oneof": [ - "timeZone" - ] - } - }, - "fields": { - "hour": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "minute": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "timeZone": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - } - } - }, - "BusinessDayConfig": { - "fields": { - "businessDays": { - "rule": "repeated", - "type": "Weekday", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "Weekday": { - "values": { - "WEEKDAY_UNSPECIFIED": 0, - "MONDAY": 1, - "TUESDAY": 2, - "WEDNESDAY": 3, - "THURSDAY": 4, - "FRIDAY": 5, - "SATURDAY": 6, - "SUNDAY": 7 - } - } - } - }, - "WarehouseBasedDeliveryTime": { - "oneofs": { - "_carrier": { - "oneof": [ - "carrier" - ] - }, - "_carrierService": { - "oneof": [ - "carrierService" - ] - }, - "_warehouse": { - "oneof": [ - "warehouse" - ] - } - }, - "fields": { - "carrier": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "carrierService": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "warehouse": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - } - } - }, - "RateGroup": { - "oneofs": { - "_singleValue": { - "oneof": [ - "singleValue" - ] - }, - "_mainTable": { - "oneof": [ - "mainTable" - ] - }, - "_name": { - "oneof": [ - "name" - ] - } - }, - "fields": { - "applicableShippingLabels": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "singleValue": { - "type": "Value", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "mainTable": { - "type": "Table", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "subtables": { - "rule": "repeated", - "type": "Table", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "carrierRates": { - "rule": "repeated", - "type": "CarrierRate", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "Table": { - "oneofs": { - "_name": { - "oneof": [ - "name" - ] - }, - "_rowHeaders": { - "oneof": [ - "rowHeaders" - ] - }, - "_columnHeaders": { - "oneof": [ - "columnHeaders" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "rowHeaders": { - "type": "Headers", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "columnHeaders": { - "type": "Headers", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "rows": { - "rule": "repeated", - "type": "Row", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TransitTable": { - "fields": { - "postalCodeGroupNames": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "transitTimeLabels": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "rows": { - "rule": "repeated", - "type": "TransitTimeRow", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "TransitTimeRow": { - "fields": { - "values": { - "rule": "repeated", - "type": "TransitTimeValue", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "TransitTimeValue": { - "oneofs": { - "_minTransitDays": { - "oneof": [ - "minTransitDays" - ] - }, - "_maxTransitDays": { - "oneof": [ - "maxTransitDays" - ] - } - }, - "fields": { - "minTransitDays": { - "type": "int32", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "maxTransitDays": { - "type": "int32", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - } - } - } - } - }, - "MinimumOrderValueTable": { - "fields": { - "storeCodeSetWithMovs": { - "rule": "repeated", - "type": "StoreCodeSetWithMov", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "StoreCodeSetWithMov": { - "oneofs": { - "_value": { - "oneof": [ - "value" - ] - } - }, - "fields": { - "storeCodes": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "value": { - "type": "google.shopping.type.Price", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - } - } - }, - "Headers": { - "fields": { - "prices": { - "rule": "repeated", - "type": "google.shopping.type.Price", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "weights": { - "rule": "repeated", - "type": "google.shopping.type.Weight", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "numberOfItems": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "postalCodeGroupNames": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "locations": { - "rule": "repeated", - "type": "LocationIdSet", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "LocationIdSet": { - "fields": { - "locationIds": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Row": { - "fields": { - "cells": { - "rule": "repeated", - "type": "Value", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Value": { - "oneofs": { - "_noShipping": { - "oneof": [ - "noShipping" - ] - }, - "_flatRate": { - "oneof": [ - "flatRate" - ] - }, - "_pricePercentage": { - "oneof": [ - "pricePercentage" - ] - }, - "_carrierRate": { - "oneof": [ - "carrierRate" - ] - }, - "_subtable": { - "oneof": [ - "subtable" - ] - } - }, - "fields": { - "noShipping": { - "type": "bool", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "flatRate": { - "type": "google.shopping.type.Price", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "pricePercentage": { - "type": "string", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "carrierRate": { - "type": "string", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "subtable": { - "type": "string", - "id": 5, - "options": { - "proto3_optional": true - } - } - } - }, - "CarrierRate": { - "oneofs": { - "_name": { - "oneof": [ - "name" - ] - }, - "_carrier": { - "oneof": [ - "carrier" - ] - }, - "_carrierService": { - "oneof": [ - "carrierService" - ] - }, - "_originPostalCode": { - "oneof": [ - "originPostalCode" - ] - }, - "_percentageAdjustment": { - "oneof": [ - "percentageAdjustment" - ] - }, - "_flatAdjustment": { - "oneof": [ - "flatAdjustment" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "carrier": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "carrierService": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "originPostalCode": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "percentageAdjustment": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "flatAdjustment": { - "type": "google.shopping.type.Price", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "GetShippingSettingsRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/ShippingSettings" - } - } - } - }, - "InsertShippingSettingsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "shippingSetting": { - "type": "ShippingSettings", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TermsOfServiceService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetTermsOfService": { - "requestType": "GetTermsOfServiceRequest", - "responseType": "TermsOfService", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=termsOfService/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=termsOfService/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "RetrieveLatestTermsOfService": { - "requestType": "RetrieveLatestTermsOfServiceRequest", - "responseType": "TermsOfService", - "options": { - "(google.api.http).get": "/accounts/v1beta/termsOfService:retrieveLatest" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/termsOfService:retrieveLatest" - } - } - ] - }, - "AcceptTermsOfService": { - "requestType": "AcceptTermsOfServiceRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=termsOfService/*}:accept", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=termsOfService/*}:accept" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "TermsOfService": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/TermsOfService", - "(google.api.resource).pattern": "termsOfService/{version}" - }, - "oneofs": { - "_fileUri": { - "oneof": [ - "fileUri" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" - } - }, - "regionCode": { - "type": "string", - "id": 2 - }, - "kind": { - "type": "TermsOfServiceKind", - "id": 3 - }, - "fileUri": { - "type": "string", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "external": { - "type": "bool", - "id": 5 - } - } - }, - "GetTermsOfServiceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" - } - } - } - }, - "RetrieveLatestTermsOfServiceRequest": { - "fields": { - "regionCode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kind": { - "type": "TermsOfServiceKind", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AcceptTermsOfServiceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" - } - }, - "account": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - }, - "regionCode": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TermsOfServiceKind": { - "values": { - "TERMS_OF_SERVICE_KIND_UNSPECIFIED": 0, - "MERCHANT_CENTER": 1 - } - }, - "TermsOfServiceAgreementStateService": { - "options": { - "(google.api.default_host)": "merchantapi.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/content" - }, - "methods": { - "GetTermsOfServiceAgreementState": { - "requestType": "GetTermsOfServiceAgreementStateRequest", - "responseType": "TermsOfServiceAgreementState", - "options": { - "(google.api.http).get": "/accounts/v1beta/{name=accounts/*/termsOfServiceAgreementStates/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{name=accounts/*/termsOfServiceAgreementStates/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "RetrieveForApplicationTermsOfServiceAgreementState": { - "requestType": "RetrieveForApplicationTermsOfServiceAgreementStateRequest", - "responseType": "TermsOfServiceAgreementState", - "options": { - "(google.api.http).get": "/accounts/v1beta/{parent=accounts/*}/termsOfServiceAgreementStates:retrieveForApplication", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/accounts/v1beta/{parent=accounts/*}/termsOfServiceAgreementStates:retrieveForApplication" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "TermsOfServiceAgreementState": { - "options": { - "(google.api.resource).type": "merchantapi.googleapis.com/TermsOfServiceAgreementState", - "(google.api.resource).pattern": "accounts/{account}/termsOfServiceAgreementStates/{identifier}", - "(google.api.resource).plural": "termsOfServiceAgreementStates", - "(google.api.resource).singular": "termsOfServiceAgreementState" - }, - "oneofs": { - "_accepted": { - "oneof": [ - "accepted" - ] - }, - "_required": { - "oneof": [ - "required" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "regionCode": { - "type": "string", - "id": 2 - }, - "termsOfServiceKind": { - "type": "TermsOfServiceKind", - "id": 3 - }, - "accepted": { - "type": "Accepted", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "required": { - "type": "Required", - "id": 5, - "options": { - "proto3_optional": true - } - } - } - }, - "Accepted": { - "oneofs": { - "_validUntil": { - "oneof": [ - "validUntil" - ] - } - }, - "fields": { - "termsOfService": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" - } - }, - "acceptedBy": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "merchantapi.googleapis.com/Account" - } - }, - "validUntil": { - "type": "google.type.Date", - "id": 3, - "options": { - "proto3_optional": true - } - } - } - }, - "Required": { - "fields": { - "termsOfService": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfService" - } - }, - "tosFileUri": { - "type": "string", - "id": 2 - } - } - }, - "GetTermsOfServiceAgreementStateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "merchantapi.googleapis.com/TermsOfServiceAgreementState" - } - } - } - }, - "RetrieveForApplicationTermsOfServiceAgreementStateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "merchantapi.googleapis.com/TermsOfServiceAgreementState" - } - } - } - } - } - } - } - } - } - }, - "type": { - "options": { - "csharp_namespace": "Google.Shopping.Type", - "go_package": "cloud.google.com/go/shopping/type/typepb;typepb", - "java_multiple_files": true, - "java_outer_classname": "TypesProto", - "java_package": "com.google.shopping.type" - }, - "nested": { - "Weight": { - "oneofs": { - "_amountMicros": { - "oneof": [ - "amountMicros" - ] - } - }, - "fields": { - "amountMicros": { - "type": "int64", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "unit": { - "type": "WeightUnit", - "id": 2 - } - }, - "nested": { - "WeightUnit": { - "values": { - "WEIGHT_UNIT_UNSPECIFIED": 0, - "POUND": 1, - "KILOGRAM": 2 - } - } - } - }, - "Price": { - "oneofs": { - "_amountMicros": { - "oneof": [ - "amountMicros" - ] - }, - "_currencyCode": { - "oneof": [ - "currencyCode" - ] - } - }, - "fields": { - "amountMicros": { - "type": "int64", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "currencyCode": { - "type": "string", - "id": 2, - "options": { - "proto3_optional": true - } - } - } - }, - "CustomAttribute": { - "oneofs": { - "_name": { - "oneof": [ - "name" - ] - }, - "_value": { - "oneof": [ - "value" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "value": { - "type": "string", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "groupValues": { - "rule": "repeated", - "type": "CustomAttribute", - "id": 3 - } - } - }, - "Destination": { - "fields": {}, - "nested": { - "DestinationEnum": { - "values": { - "DESTINATION_ENUM_UNSPECIFIED": 0, - "SHOPPING_ADS": 1, - "DISPLAY_ADS": 2, - "LOCAL_INVENTORY_ADS": 3, - "FREE_LISTINGS": 4, - "FREE_LOCAL_LISTINGS": 5, - "YOUTUBE_SHOPPING": 6 - } - } - } - }, - "ReportingContext": { - "fields": {}, - "nested": { - "ReportingContextEnum": { - "valuesOptions": { - "DISCOVERY_ADS": { - "deprecated": true - } - }, - "values": { - "REPORTING_CONTEXT_ENUM_UNSPECIFIED": 0, - "SHOPPING_ADS": 1, - "DISCOVERY_ADS": 2, - "DEMAND_GEN_ADS": 13, - "DEMAND_GEN_ADS_DISCOVER_SURFACE": 14, - "VIDEO_ADS": 3, - "DISPLAY_ADS": 4, - "LOCAL_INVENTORY_ADS": 5, - "VEHICLE_INVENTORY_ADS": 6, - "FREE_LISTINGS": 7, - "FREE_LOCAL_LISTINGS": 8, - "FREE_LOCAL_VEHICLE_LISTINGS": 9, - "YOUTUBE_SHOPPING": 10, - "CLOUD_RETAIL": 11, - "LOCAL_CLOUD_RETAIL": 12 - } - } - } - }, - "Channel": { - "fields": {}, - "nested": { - "ChannelEnum": { - "values": { - "CHANNEL_ENUM_UNSPECIFIED": 0, - "ONLINE": 1, - "LOCAL": 2 - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19, - "options": { - "packed": false - } - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "DoubleValue": { - "fields": { - "value": { - "type": "double", - "id": 1 - } - } - }, - "FloatValue": { - "fields": { - "value": { - "type": "float", - "id": 1 - } - } - }, - "Int64Value": { - "fields": { - "value": { - "type": "int64", - "id": 1 - } - } - }, - "UInt64Value": { - "fields": { - "value": { - "type": "uint64", - "id": 1 - } - } - }, - "Int32Value": { - "fields": { - "value": { - "type": "int32", - "id": 1 - } - } - }, - "UInt32Value": { - "fields": { - "value": { - "type": "uint32", - "id": 1 - } - } - }, - "BoolValue": { - "fields": { - "value": { - "type": "bool", - "id": 1 - } - } - }, - "StringValue": { - "fields": { - "value": { - "type": "string", - "id": 1 - } - } - }, - "BytesValue": { - "fields": { - "value": { - "type": "bytes", - "id": 1 - } - } - } - } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/date;date", - "java_multiple_files": true, - "java_outer_classname": "DateProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Interval": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - }, - "DateTime": { - "oneofs": { - "timeOffset": { - "oneof": [ - "utcOffset", - "timeZone" - ] - } - }, - "fields": { - "year": { - "type": "int32", - "id": 1 - }, - "month": { - "type": "int32", - "id": 2 - }, - "day": { - "type": "int32", - "id": 3 - }, - "hours": { - "type": "int32", - "id": 4 - }, - "minutes": { - "type": "int32", - "id": 5 - }, - "seconds": { - "type": "int32", - "id": 6 - }, - "nanos": { - "type": "int32", - "id": 7 - }, - "utcOffset": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "timeZone": { - "type": "TimeZone", - "id": 9 - } - } - }, - "TimeZone": { - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "version": { - "type": "string", - "id": 2 - } - } - }, - "PhoneNumber": { - "oneofs": { - "kind": { - "oneof": [ - "e164Number", - "shortCode" - ] - } - }, - "fields": { - "e164Number": { - "type": "string", - "id": 1 - }, - "shortCode": { - "type": "ShortCode", - "id": 2 - }, - "extension": { - "type": "string", - "id": 3 - } - }, - "nested": { - "ShortCode": { - "fields": { - "regionCode": { - "type": "string", - "id": 1 - }, - "number": { - "type": "string", - "id": 2 - } - } - } - } - }, - "PostalAddress": { - "fields": { - "revision": { - "type": "int32", - "id": 1 - }, - "regionCode": { - "type": "string", - "id": 2 - }, - "languageCode": { - "type": "string", - "id": 3 - }, - "postalCode": { - "type": "string", - "id": 4 - }, - "sortingCode": { - "type": "string", - "id": 5 - }, - "administrativeArea": { - "type": "string", - "id": 6 - }, - "locality": { - "type": "string", - "id": 7 - }, - "sublocality": { - "type": "string", - "id": 8 - }, - "addressLines": { - "rule": "repeated", - "type": "string", - "id": 9 - }, - "recipients": { - "rule": "repeated", - "type": "string", - "id": 10 - }, - "organization": { - "type": "string", - "id": 11 - } - } - }, - "Date": { - "fields": { - "year": { - "type": "int32", - "id": 1 - }, - "month": { - "type": "int32", - "id": 2 - }, - "day": { - "type": "int32", - "id": 3 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_issue_service.list_account_issues.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_issue_service.list_account_issues.js deleted file mode 100644 index 26ab7580cda..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_issue_service.list_account_issues.js +++ /dev/null @@ -1,90 +0,0 @@ -// 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(parent) { - // [START merchantapi_v1beta_generated_AccountIssueService_ListAccountIssues_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns this collection of issues. - * Format: `accounts/{account}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of issues to return. The service may return - * fewer than this value. If unspecified, at most 50 users will be returned. - * The maximum value is 100; values above 100 will be coerced to 100 - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListAccountIssues` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccountIssues` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Optional. The issues in the response will have human-readable fields in the - * 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. - */ - // const languageCode = 'abc123' - /** - * 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. - */ - // const timeZone = 'abc123' - - // Imports the Accounts library - const {AccountIssueServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountIssueServiceClient(); - - async function callListAccountIssues() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = accountsClient.listAccountIssuesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAccountIssues(); - // [END merchantapi_v1beta_generated_AccountIssueService_ListAccountIssues_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.get_account_tax.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.get_account_tax.js deleted file mode 100644 index 41bf05fd6d7..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.get_account_tax.js +++ /dev/null @@ -1,61 +0,0 @@ -// 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_AccountTaxService_GetAccountTax_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name from which tax settings will be retrieved - */ - // const name = 'abc123' - - // Imports the Accounts library - const {AccountTaxServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountTaxServiceClient(); - - async function callGetAccountTax() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getAccountTax(request); - console.log(response); - } - - callGetAccountTax(); - // [END merchantapi_v1beta_generated_AccountTaxService_GetAccountTax_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.list_account_tax.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.list_account_tax.js deleted file mode 100644 index d5bdaf19232..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.list_account_tax.js +++ /dev/null @@ -1,73 +0,0 @@ -// 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(parent) { - // [START merchantapi_v1beta_generated_AccountTaxService_ListAccountTax_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns this collection of account tax. - * Format: accounts/{account} - */ - // const parent = 'abc123' - /** - * The maximum number of tax settings to return in the response, used for - * paging. - */ - // const pageSize = 1234 - /** - * The token returned by the previous request. - */ - // const pageToken = 'abc123' - - // Imports the Accounts library - const {AccountTaxServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountTaxServiceClient(); - - async function callListAccountTax() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = accountsClient.listAccountTaxAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAccountTax(); - // [END merchantapi_v1beta_generated_AccountTaxService_ListAccountTax_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.update_account_tax.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.update_account_tax.js deleted file mode 100644 index 13c82cf8b3a..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/account_tax_service.update_account_tax.js +++ /dev/null @@ -1,65 +0,0 @@ -// 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(accountTax) { - // [START merchantapi_v1beta_generated_AccountTaxService_UpdateAccountTax_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 tax setting that will be updated - */ - // const accountTax = {} - /** - * The list of fields to be updated - */ - // const updateMask = {} - - // Imports the Accounts library - const {AccountTaxServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountTaxServiceClient(); - - async function callUpdateAccountTax() { - // Construct request - const request = { - accountTax, - }; - - // Run request - const response = await accountsClient.updateAccountTax(request); - console.log(response); - } - - callUpdateAccountTax(); - // [END merchantapi_v1beta_generated_AccountTaxService_UpdateAccountTax_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.create_and_configure_account.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.create_and_configure_account.js deleted file mode 100644 index 19886628937..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.create_and_configure_account.js +++ /dev/null @@ -1,80 +0,0 @@ -// 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(account, service) { - // [START merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account to be created. - */ - // const account = {} - /** - * Optional. Users to be added to the account. - */ - // const users = [1,2,3,4] - /** - * Optional. The Terms of Service (ToS) to be accepted immediately upon - * account creation. - */ - // const acceptTermsOfService = {} - /** - * 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] - - // Imports the Accounts library - const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountsServiceClient(); - - async function callCreateAndConfigureAccount() { - // Construct request - const request = { - account, - service, - }; - - // Run request - const response = await accountsClient.createAndConfigureAccount(request); - console.log(response); - } - - callCreateAndConfigureAccount(); - // [END merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.delete_account.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.delete_account.js deleted file mode 100644 index 5032978f777..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.delete_account.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_AccountsService_DeleteAccount_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the account to delete. - * Format: `accounts/{account}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountsServiceClient(); - - async function callDeleteAccount() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.deleteAccount(request); - console.log(response); - } - - callDeleteAccount(); - // [END merchantapi_v1beta_generated_AccountsService_DeleteAccount_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.get_account.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.get_account.js deleted file mode 100644 index 04ba41ca85b..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.get_account.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_AccountsService_GetAccount_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the account to retrieve. - * Format: `accounts/{account}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountsServiceClient(); - - async function callGetAccount() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getAccount(request); - console.log(response); - } - - callGetAccount(); - // [END merchantapi_v1beta_generated_AccountsService_GetAccount_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_accounts.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_accounts.js deleted file mode 100644 index 37f2375c43a..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_accounts.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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() { - // [START merchantapi_v1beta_generated_AccountsService_ListAccounts_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. - */ - /** - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 250 accounts are returned. - * The maximum value is 500; values above 500 are coerced to 500. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccounts` must match - * the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Optional. Returns only accounts that match the - * filter (/merchant/api/guides/accounts/filter). - * For more details, see the - * filter syntax reference (/merchant/api/guides/accounts/filter-syntax). - */ - // const filter = 'abc123' - - // Imports the Accounts library - const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountsServiceClient(); - - async function callListAccounts() { - // Construct request - const request = { - }; - - // Run request - const iterable = accountsClient.listAccountsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAccounts(); - // [END merchantapi_v1beta_generated_AccountsService_ListAccounts_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_sub_accounts.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_sub_accounts.js deleted file mode 100644 index 991fac306bc..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.list_sub_accounts.js +++ /dev/null @@ -1,77 +0,0 @@ -// 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(provider) { - // [START merchantapi_v1beta_generated_AccountsService_ListSubAccounts_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent account. - * Format: `accounts/{account}` - */ - // const provider = 'abc123' - /** - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 250 accounts are returned. - * The maximum value is 500; values above 500 are coerced to 500. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListAccounts` must match - * the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Accounts library - const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountsServiceClient(); - - async function callListSubAccounts() { - // Construct request - const request = { - provider, - }; - - // Run request - const iterable = accountsClient.listSubAccountsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSubAccounts(); - // [END merchantapi_v1beta_generated_AccountsService_ListSubAccounts_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.update_account.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.update_account.js deleted file mode 100644 index e6a98f42c69..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/accounts_service.update_account.js +++ /dev/null @@ -1,66 +0,0 @@ -// 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(account, updateMask) { - // [START merchantapi_v1beta_generated_AccountsService_UpdateAccount_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 account. - */ - // const account = {} - /** - * Required. List of fields being updated. - */ - // const updateMask = {} - - // Imports the Accounts library - const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new AccountsServiceClient(); - - async function callUpdateAccount() { - // Construct request - const request = { - account, - updateMask, - }; - - // Run request - const response = await accountsClient.updateAccount(request); - console.log(response); - } - - callUpdateAccount(); - // [END merchantapi_v1beta_generated_AccountsService_UpdateAccount_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.get_business_identity.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.get_business_identity.js deleted file mode 100644 index 6de63c9574e..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.get_business_identity.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_BusinessIdentityService_GetBusinessIdentity_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 business identity. - * Format: `accounts/{account}/businessIdentity` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {BusinessIdentityServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new BusinessIdentityServiceClient(); - - async function callGetBusinessIdentity() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getBusinessIdentity(request); - console.log(response); - } - - callGetBusinessIdentity(); - // [END merchantapi_v1beta_generated_BusinessIdentityService_GetBusinessIdentity_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.update_business_identity.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.update_business_identity.js deleted file mode 100644 index 6ff89f287d2..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_identity_service.update_business_identity.js +++ /dev/null @@ -1,66 +0,0 @@ -// 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(businessIdentity, updateMask) { - // [START merchantapi_v1beta_generated_BusinessIdentityService_UpdateBusinessIdentity_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 business identity. - */ - // const businessIdentity = {} - /** - * Required. List of fields being updated. - */ - // const updateMask = {} - - // Imports the Accounts library - const {BusinessIdentityServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new BusinessIdentityServiceClient(); - - async function callUpdateBusinessIdentity() { - // Construct request - const request = { - businessIdentity, - updateMask, - }; - - // Run request - const response = await accountsClient.updateBusinessIdentity(request); - console.log(response); - } - - callUpdateBusinessIdentity(); - // [END merchantapi_v1beta_generated_BusinessIdentityService_UpdateBusinessIdentity_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.get_business_info.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.get_business_info.js deleted file mode 100644 index b07cab733a8..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.get_business_info.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_BusinessInfoService_GetBusinessInfo_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 business info. - * Format: `accounts/{account}/businessInfo` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {BusinessInfoServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new BusinessInfoServiceClient(); - - async function callGetBusinessInfo() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getBusinessInfo(request); - console.log(response); - } - - callGetBusinessInfo(); - // [END merchantapi_v1beta_generated_BusinessInfoService_GetBusinessInfo_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.update_business_info.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.update_business_info.js deleted file mode 100644 index d9ff567ba33..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/business_info_service.update_business_info.js +++ /dev/null @@ -1,66 +0,0 @@ -// 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(businessInfo, updateMask) { - // [START merchantapi_v1beta_generated_BusinessInfoService_UpdateBusinessInfo_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 business info. - */ - // const businessInfo = {} - /** - * Required. List of fields being updated. - */ - // const updateMask = {} - - // Imports the Accounts library - const {BusinessInfoServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new BusinessInfoServiceClient(); - - async function callUpdateBusinessInfo() { - // Construct request - const request = { - businessInfo, - updateMask, - }; - - // Run request - const response = await accountsClient.updateBusinessInfo(request); - console.log(response); - } - - callUpdateBusinessInfo(); - // [END merchantapi_v1beta_generated_BusinessInfoService_UpdateBusinessInfo_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.get_email_preferences.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.get_email_preferences.js deleted file mode 100644 index 7a2d7fe6e49..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.get_email_preferences.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_EmailPreferencesService_GetEmailPreferences_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the `EmailPreferences` resource. - * Format: `accounts/{account}/users/{email}/emailPreferences` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {EmailPreferencesServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new EmailPreferencesServiceClient(); - - async function callGetEmailPreferences() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getEmailPreferences(request); - console.log(response); - } - - callGetEmailPreferences(); - // [END merchantapi_v1beta_generated_EmailPreferencesService_GetEmailPreferences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.update_email_preferences.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.update_email_preferences.js deleted file mode 100644 index df95fc7d254..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/email_preferences_service.update_email_preferences.js +++ /dev/null @@ -1,66 +0,0 @@ -// 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(emailPreferences, updateMask) { - // [START merchantapi_v1beta_generated_EmailPreferencesService_UpdateEmailPreferences_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. Email Preferences to be updated. - */ - // const emailPreferences = {} - /** - * Required. List of fields being updated. - */ - // const updateMask = {} - - // Imports the Accounts library - const {EmailPreferencesServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new EmailPreferencesServiceClient(); - - async function callUpdateEmailPreferences() { - // Construct request - const request = { - emailPreferences, - updateMask, - }; - - // Run request - const response = await accountsClient.updateEmailPreferences(request); - console.log(response); - } - - callUpdateEmailPreferences(); - // [END merchantapi_v1beta_generated_EmailPreferencesService_UpdateEmailPreferences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.claim_homepage.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.claim_homepage.js deleted file mode 100644 index 8907fa743d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.claim_homepage.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_HomepageService_ClaimHomepage_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the homepage to claim. - * Format: `accounts/{account}/homepage` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {HomepageServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new HomepageServiceClient(); - - async function callClaimHomepage() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.claimHomepage(request); - console.log(response); - } - - callClaimHomepage(); - // [END merchantapi_v1beta_generated_HomepageService_ClaimHomepage_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.get_homepage.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.get_homepage.js deleted file mode 100644 index edddeb98e52..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.get_homepage.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_HomepageService_GetHomepage_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the homepage to retrieve. - * Format: `accounts/{account}/homepage` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {HomepageServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new HomepageServiceClient(); - - async function callGetHomepage() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getHomepage(request); - console.log(response); - } - - callGetHomepage(); - // [END merchantapi_v1beta_generated_HomepageService_GetHomepage_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.unclaim_homepage.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.unclaim_homepage.js deleted file mode 100644 index df187be8337..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.unclaim_homepage.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_HomepageService_UnclaimHomepage_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the homepage to unclaim. - * Format: `accounts/{account}/homepage` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {HomepageServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new HomepageServiceClient(); - - async function callUnclaimHomepage() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.unclaimHomepage(request); - console.log(response); - } - - callUnclaimHomepage(); - // [END merchantapi_v1beta_generated_HomepageService_UnclaimHomepage_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.update_homepage.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.update_homepage.js deleted file mode 100644 index cca7b31d7c1..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/homepage_service.update_homepage.js +++ /dev/null @@ -1,66 +0,0 @@ -// 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(homepage, updateMask) { - // [START merchantapi_v1beta_generated_HomepageService_UpdateHomepage_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 homepage. - */ - // const homepage = {} - /** - * Required. List of fields being updated. - */ - // const updateMask = {} - - // Imports the Accounts library - const {HomepageServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new HomepageServiceClient(); - - async function callUpdateHomepage() { - // Construct request - const request = { - homepage, - updateMask, - }; - - // Run request - const response = await accountsClient.updateHomepage(request); - console.log(response); - } - - callUpdateHomepage(); - // [END merchantapi_v1beta_generated_HomepageService_UpdateHomepage_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.get_online_return_policy.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.get_online_return_policy.js deleted file mode 100644 index 22270390360..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.get_online_return_policy.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_OnlineReturnPolicyService_GetOnlineReturnPolicy_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the return policy to retrieve. - * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {OnlineReturnPolicyServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new OnlineReturnPolicyServiceClient(); - - async function callGetOnlineReturnPolicy() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getOnlineReturnPolicy(request); - console.log(response); - } - - callGetOnlineReturnPolicy(); - // [END merchantapi_v1beta_generated_OnlineReturnPolicyService_GetOnlineReturnPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js deleted file mode 100644 index 15bd92d118f..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js +++ /dev/null @@ -1,82 +0,0 @@ -// 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(parent) { - // [START merchantapi_v1beta_generated_OnlineReturnPolicyService_ListOnlineReturnPolicies_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 merchant account for which to list return policies. - * Format: `accounts/{account}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of `OnlineReturnPolicy` resources to return. - * The service returns fewer than this value if the number of return policies - * for the given merchant is less that than the `pageSize`. The default value - * is 10. The maximum value is 100; If a value higher than the maximum is - * specified, then the `pageSize` will default to the maximum - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListOnlineReturnPolicies` - * call. Provide the page token to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListOnlineReturnPolicies` must match the call that provided the page - * token. The token returned as - * nextPageToken google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token - * in the response to the previous request. - */ - // const pageToken = 'abc123' - - // Imports the Accounts library - const {OnlineReturnPolicyServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new OnlineReturnPolicyServiceClient(); - - async function callListOnlineReturnPolicies() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = accountsClient.listOnlineReturnPoliciesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListOnlineReturnPolicies(); - // [END merchantapi_v1beta_generated_OnlineReturnPolicyService_ListOnlineReturnPolicies_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.disable_program.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.disable_program.js deleted file mode 100644 index ec1af5019c0..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.disable_program.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_ProgramsService_DisableProgram_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the program for which to disable participation for - * the given account. Format: `accounts/{account}/programs/{program}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {ProgramsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new ProgramsServiceClient(); - - async function callDisableProgram() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.disableProgram(request); - console.log(response); - } - - callDisableProgram(); - // [END merchantapi_v1beta_generated_ProgramsService_DisableProgram_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.enable_program.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.enable_program.js deleted file mode 100644 index 0d8ac79b721..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.enable_program.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_ProgramsService_EnableProgram_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the program for which to enable participation for the - * given account. Format: `accounts/{account}/programs/{program}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {ProgramsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new ProgramsServiceClient(); - - async function callEnableProgram() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.enableProgram(request); - console.log(response); - } - - callEnableProgram(); - // [END merchantapi_v1beta_generated_ProgramsService_EnableProgram_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.get_program.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.get_program.js deleted file mode 100644 index 9148cc32d12..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.get_program.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_ProgramsService_GetProgram_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the program to retrieve. - * Format: `accounts/{account}/programs/{program}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {ProgramsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new ProgramsServiceClient(); - - async function callGetProgram() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getProgram(request); - console.log(response); - } - - callGetProgram(); - // [END merchantapi_v1beta_generated_ProgramsService_GetProgram_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.list_programs.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.list_programs.js deleted file mode 100644 index 8dc90d27f8d..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/programs_service.list_programs.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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(parent) { - // [START merchantapi_v1beta_generated_ProgramsService_ListPrograms_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the account for which to retrieve all programs. - * Format: `accounts/{account}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of programs to return in a single response. If - * unspecified (or 0), a default size of 1000 is used. The maximum value is - * 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * Optional. A continuation token, received from a previous `ListPrograms` - * call. Provide this to retrieve the next page. - */ - // const pageToken = 'abc123' - - // Imports the Accounts library - const {ProgramsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new ProgramsServiceClient(); - - async function callListPrograms() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = accountsClient.listProgramsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListPrograms(); - // [END merchantapi_v1beta_generated_ProgramsService_ListPrograms_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.create_region.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.create_region.js deleted file mode 100644 index 78e0328ecec..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.create_region.js +++ /dev/null @@ -1,73 +0,0 @@ -// 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(parent, regionId, region) { - // [START merchantapi_v1beta_generated_RegionsService_CreateRegion_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account to create a region for. - * Format: `accounts/{account}` - */ - // const parent = 'abc123' - /** - * Required. The identifier for the region, unique over all regions of the - * same account. - */ - // const regionId = 'abc123' - /** - * Required. The region to create. - */ - // const region = 'us-central1' - - // Imports the Accounts library - const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new RegionsServiceClient(); - - async function callCreateRegion() { - // Construct request - const request = { - parent, - regionId, - region, - }; - - // Run request - const response = await accountsClient.createRegion(request); - console.log(response); - } - - callCreateRegion(); - // [END merchantapi_v1beta_generated_RegionsService_CreateRegion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.delete_region.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.delete_region.js deleted file mode 100644 index 96bb94e45a3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.delete_region.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_RegionsService_DeleteRegion_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the region to delete. - * Format: `accounts/{account}/regions/{region}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new RegionsServiceClient(); - - async function callDeleteRegion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.deleteRegion(request); - console.log(response); - } - - callDeleteRegion(); - // [END merchantapi_v1beta_generated_RegionsService_DeleteRegion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.get_region.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.get_region.js deleted file mode 100644 index 575804d174a..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.get_region.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_RegionsService_GetRegion_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the region to retrieve. - * Format: `accounts/{account}/regions/{region}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new RegionsServiceClient(); - - async function callGetRegion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getRegion(request); - console.log(response); - } - - callGetRegion(); - // [END merchantapi_v1beta_generated_RegionsService_GetRegion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.list_regions.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.list_regions.js deleted file mode 100644 index b34b2e08b3d..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.list_regions.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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(parent) { - // [START merchantapi_v1beta_generated_RegionsService_ListRegions_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account to list regions for. - * Format: `accounts/{account}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of regions to return. The service may return - * fewer than this value. - * If unspecified, at most 50 regions will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListRegions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListRegions` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Accounts library - const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new RegionsServiceClient(); - - async function callListRegions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = accountsClient.listRegionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListRegions(); - // [END merchantapi_v1beta_generated_RegionsService_ListRegions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.update_region.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.update_region.js deleted file mode 100644 index 992eb3150d5..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/regions_service.update_region.js +++ /dev/null @@ -1,67 +0,0 @@ -// 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(region) { - // [START merchantapi_v1beta_generated_RegionsService_UpdateRegion_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 updated region. - */ - // const region = 'us-central1' - /** - * Optional. The comma-separated field mask indicating the fields to update. - * Example: - * `"displayName,postalCodeArea.regionCode"`. - */ - // const updateMask = {} - - // Imports the Accounts library - const {RegionsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new RegionsServiceClient(); - - async function callUpdateRegion() { - // Construct request - const request = { - region, - }; - - // Run request - const response = await accountsClient.updateRegion(request); - console.log(response); - } - - callUpdateRegion(); - // [END merchantapi_v1beta_generated_RegionsService_UpdateRegion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.get_shipping_settings.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.get_shipping_settings.js deleted file mode 100644 index 0f091840e21..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.get_shipping_settings.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_ShippingSettingsService_GetShippingSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the shipping setting to retrieve. - * Format: `accounts/{account}/shippingsetting` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {ShippingSettingsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new ShippingSettingsServiceClient(); - - async function callGetShippingSettings() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getShippingSettings(request); - console.log(response); - } - - callGetShippingSettings(); - // [END merchantapi_v1beta_generated_ShippingSettingsService_GetShippingSettings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.insert_shipping_settings.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.insert_shipping_settings.js deleted file mode 100644 index cf4ed038be3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/shipping_settings_service.insert_shipping_settings.js +++ /dev/null @@ -1,67 +0,0 @@ -// 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(parent, shippingSetting) { - // [START merchantapi_v1beta_generated_ShippingSettingsService_InsertShippingSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account where this product will be inserted. - * Format: accounts/{account} - */ - // const parent = 'abc123' - /** - * Required. The new version of the account. - */ - // const shippingSetting = {} - - // Imports the Accounts library - const {ShippingSettingsServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new ShippingSettingsServiceClient(); - - async function callInsertShippingSettings() { - // Construct request - const request = { - parent, - shippingSetting, - }; - - // Run request - const response = await accountsClient.insertShippingSettings(request); - console.log(response); - } - - callInsertShippingSettings(); - // [END merchantapi_v1beta_generated_ShippingSettingsService_InsertShippingSettings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json deleted file mode 100644 index 160fb967b63..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/snippet_metadata_google.shopping.merchant.accounts.v1beta.json +++ /dev/null @@ -1,1967 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-accounts", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.shopping.merchant.accounts.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "regionTag": "merchantapi_v1beta_generated_AccountIssueService_ListAccountIssues_async", - "title": "AccountIssueService listAccountIssues Sample", - "origin": "API_DEFINITION", - "description": " Lists all account issues of a Merchant Center account.", - "canonical": true, - "file": "account_issue_service.list_account_issues.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAccountIssues", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountIssueService.ListAccountIssues", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "language_code", - "type": "TYPE_STRING" - }, - { - "name": "time_zone", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ListAccountIssuesResponse", - "client": { - "shortName": "AccountIssueServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountIssueServiceClient" - }, - "method": { - "shortName": "ListAccountIssues", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountIssueService.ListAccountIssues", - "service": { - "shortName": "AccountIssueService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountIssueService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_AccountsService_GetAccount_async", - "title": "AccountIssueService getAccount Sample", - "origin": "API_DEFINITION", - "description": " Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.", - "canonical": true, - "file": "accounts_service.get_account.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAccount", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.GetAccount", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Account", - "client": { - "shortName": "AccountsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" - }, - "method": { - "shortName": "GetAccount", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.GetAccount", - "service": { - "shortName": "AccountsService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_async", - "title": "AccountIssueService createAndConfigureAccount Sample", - "origin": "API_DEFINITION", - "description": " Creates a standalone Merchant Center account with additional configuration. Adds the user that makes the request as an admin for the new account.", - "canonical": true, - "file": "accounts_service.create_and_configure_account.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAndConfigureAccount", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.CreateAndConfigureAccount", - "async": true, - "parameters": [ - { - "name": "account", - "type": ".google.shopping.merchant.accounts.v1beta.Account" - }, - { - "name": "users", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "accept_terms_of_service", - "type": ".google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest.AcceptTermsOfService" - }, - { - "name": "service", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Account", - "client": { - "shortName": "AccountsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" - }, - "method": { - "shortName": "CreateAndConfigureAccount", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.CreateAndConfigureAccount", - "service": { - "shortName": "AccountsService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_AccountsService_DeleteAccount_async", - "title": "AccountIssueService deleteAccount Sample", - "origin": "API_DEFINITION", - "description": " Deletes the specified account regardless of its type: standalone, MCA or sub-account. Deleting an MCA leads to the deletion of all of its sub-accounts. Executing this method requires admin access.", - "canonical": true, - "file": "accounts_service.delete_account.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAccount", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.DeleteAccount", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AccountsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" - }, - "method": { - "shortName": "DeleteAccount", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.DeleteAccount", - "service": { - "shortName": "AccountsService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_AccountsService_UpdateAccount_async", - "title": "AccountIssueService updateAccount Sample", - "origin": "API_DEFINITION", - "description": " Updates an account regardless of its type: standalone, MCA or sub-account. Executing this method requires admin access.", - "canonical": true, - "file": "accounts_service.update_account.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAccount", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.UpdateAccount", - "async": true, - "parameters": [ - { - "name": "account", - "type": ".google.shopping.merchant.accounts.v1beta.Account" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Account", - "client": { - "shortName": "AccountsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" - }, - "method": { - "shortName": "UpdateAccount", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.UpdateAccount", - "service": { - "shortName": "AccountsService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_AccountsService_ListAccounts_async", - "title": "AccountIssueService listAccounts Sample", - "origin": "API_DEFINITION", - "description": " Lists accounts accessible to the calling user and matching the constraints of the request such as page size or filters. This is not just listing the sub-accounts of an MCA, but all accounts the calling user has access to including other MCAs, linked accounts, standalone accounts and so on.", - "canonical": true, - "file": "accounts_service.list_accounts.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAccounts", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.ListAccounts", - "async": true, - "parameters": [ - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ListAccountsResponse", - "client": { - "shortName": "AccountsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" - }, - "method": { - "shortName": "ListAccounts", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.ListAccounts", - "service": { - "shortName": "AccountsService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_AccountsService_ListSubAccounts_async", - "title": "AccountIssueService listSubAccounts Sample", - "origin": "API_DEFINITION", - "description": " List all sub-accounts for a given multi client account. This is a convenience wrapper for the more powerful `ListAccounts` method. This method will produce the same results as calling `ListsAccounts` with the following filter: `relationship(providerId={parent} AND service(type=\"ACCOUNT_AGGREGATION\"))`", - "canonical": true, - "file": "accounts_service.list_sub_accounts.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSubAccounts", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.ListSubAccounts", - "async": true, - "parameters": [ - { - "name": "provider", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ListSubAccountsResponse", - "client": { - "shortName": "AccountsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsServiceClient" - }, - "method": { - "shortName": "ListSubAccounts", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService.ListSubAccounts", - "service": { - "shortName": "AccountsService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_AccountTaxService_GetAccountTax_async", - "title": "AccountIssueService getAccountTax Sample", - "origin": "API_DEFINITION", - "description": " Returns the tax rules that match the conditions of GetAccountTaxRequest", - "canonical": true, - "file": "account_tax_service.get_account_tax.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAccountTax", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.GetAccountTax", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.AccountTax", - "client": { - "shortName": "AccountTaxServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxServiceClient" - }, - "method": { - "shortName": "GetAccountTax", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.GetAccountTax", - "service": { - "shortName": "AccountTaxService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_AccountTaxService_ListAccountTax_async", - "title": "AccountIssueService listAccountTax Sample", - "origin": "API_DEFINITION", - "description": " Lists the tax settings of the sub-accounts only in your Merchant Center account. This method can only be called on a multi-client account, otherwise it'll return an error.", - "canonical": true, - "file": "account_tax_service.list_account_tax.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAccountTax", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.ListAccountTax", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ListAccountTaxResponse", - "client": { - "shortName": "AccountTaxServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxServiceClient" - }, - "method": { - "shortName": "ListAccountTax", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.ListAccountTax", - "service": { - "shortName": "AccountTaxService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_AccountTaxService_UpdateAccountTax_async", - "title": "AccountIssueService updateAccountTax Sample", - "origin": "API_DEFINITION", - "description": " Updates the tax settings of the account.", - "canonical": true, - "file": "account_tax_service.update_account_tax.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAccountTax", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.UpdateAccountTax", - "async": true, - "parameters": [ - { - "name": "account_tax", - "type": ".google.shopping.merchant.accounts.v1beta.AccountTax" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.AccountTax", - "client": { - "shortName": "AccountTaxServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxServiceClient" - }, - "method": { - "shortName": "UpdateAccountTax", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService.UpdateAccountTax", - "service": { - "shortName": "AccountTaxService", - "fullName": "google.shopping.merchant.accounts.v1beta.AccountTaxService" - } - } - } - }, - { - "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", - "origin": "API_DEFINITION", - "description": " Retrieves the business identity of an account.", - "canonical": true, - "file": "business_identity_service.get_business_identity.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBusinessIdentity", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService.GetBusinessIdentity", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.BusinessIdentity", - "client": { - "shortName": "BusinessIdentityServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityServiceClient" - }, - "method": { - "shortName": "GetBusinessIdentity", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService.GetBusinessIdentity", - "service": { - "shortName": "BusinessIdentityService", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_BusinessIdentityService_UpdateBusinessIdentity_async", - "title": "AccountIssueService updateBusinessIdentity Sample", - "origin": "API_DEFINITION", - "description": " Updates the business identity of an account. Executing this method requires admin access.", - "canonical": true, - "file": "business_identity_service.update_business_identity.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBusinessIdentity", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService.UpdateBusinessIdentity", - "async": true, - "parameters": [ - { - "name": "business_identity", - "type": ".google.shopping.merchant.accounts.v1beta.BusinessIdentity" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.BusinessIdentity", - "client": { - "shortName": "BusinessIdentityServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityServiceClient" - }, - "method": { - "shortName": "UpdateBusinessIdentity", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService.UpdateBusinessIdentity", - "service": { - "shortName": "BusinessIdentityService", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessIdentityService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_BusinessInfoService_GetBusinessInfo_async", - "title": "AccountIssueService getBusinessInfo Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the business info of an account.", - "canonical": true, - "file": "business_info_service.get_business_info.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBusinessInfo", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService.GetBusinessInfo", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.BusinessInfo", - "client": { - "shortName": "BusinessInfoServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoServiceClient" - }, - "method": { - "shortName": "GetBusinessInfo", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService.GetBusinessInfo", - "service": { - "shortName": "BusinessInfoService", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_BusinessInfoService_UpdateBusinessInfo_async", - "title": "AccountIssueService updateBusinessInfo Sample", - "origin": "API_DEFINITION", - "description": " Updates the business info of an account. Executing this method requires admin access.", - "canonical": true, - "file": "business_info_service.update_business_info.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBusinessInfo", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService.UpdateBusinessInfo", - "async": true, - "parameters": [ - { - "name": "business_info", - "type": ".google.shopping.merchant.accounts.v1beta.BusinessInfo" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.BusinessInfo", - "client": { - "shortName": "BusinessInfoServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoServiceClient" - }, - "method": { - "shortName": "UpdateBusinessInfo", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService.UpdateBusinessInfo", - "service": { - "shortName": "BusinessInfoService", - "fullName": "google.shopping.merchant.accounts.v1beta.BusinessInfoService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_EmailPreferencesService_GetEmailPreferences_async", - "title": "AccountIssueService getEmailPreferences Sample", - "origin": "API_DEFINITION", - "description": " Returns the email preferences for a Merchant Center account user. Use the name=accounts/*/users/me/emailPreferences alias to get preferences for the authenticated user.", - "canonical": true, - "file": "email_preferences_service.get_email_preferences.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEmailPreferences", - "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService.GetEmailPreferences", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.EmailPreferences", - "client": { - "shortName": "EmailPreferencesServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesServiceClient" - }, - "method": { - "shortName": "GetEmailPreferences", - "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService.GetEmailPreferences", - "service": { - "shortName": "EmailPreferencesService", - "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_EmailPreferencesService_UpdateEmailPreferences_async", - "title": "AccountIssueService updateEmailPreferences Sample", - "origin": "API_DEFINITION", - "description": " Updates the email preferences for a Merchant Center account user. MCA users should specify the MCA account rather than a sub-account of the MCA. Preferences which are not explicitly selected in the update mask will not be updated. It is invalid for updates to specify an UNCONFIRMED opt-in status value. Use the name=accounts/*/users/me/emailPreferences alias to update preferences for the authenticated user.", - "canonical": true, - "file": "email_preferences_service.update_email_preferences.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateEmailPreferences", - "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService.UpdateEmailPreferences", - "async": true, - "parameters": [ - { - "name": "email_preferences", - "type": ".google.shopping.merchant.accounts.v1beta.EmailPreferences" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.EmailPreferences", - "client": { - "shortName": "EmailPreferencesServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesServiceClient" - }, - "method": { - "shortName": "UpdateEmailPreferences", - "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService.UpdateEmailPreferences", - "service": { - "shortName": "EmailPreferencesService", - "fullName": "google.shopping.merchant.accounts.v1beta.EmailPreferencesService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_HomepageService_GetHomepage_async", - "title": "AccountIssueService getHomepage Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a store's homepage.", - "canonical": true, - "file": "homepage_service.get_homepage.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetHomepage", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.GetHomepage", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Homepage", - "client": { - "shortName": "HomepageServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageServiceClient" - }, - "method": { - "shortName": "GetHomepage", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.GetHomepage", - "service": { - "shortName": "HomepageService", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_HomepageService_UpdateHomepage_async", - "title": "AccountIssueService updateHomepage Sample", - "origin": "API_DEFINITION", - "description": " Updates a store's homepage. Executing this method requires admin access.", - "canonical": true, - "file": "homepage_service.update_homepage.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateHomepage", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.UpdateHomepage", - "async": true, - "parameters": [ - { - "name": "homepage", - "type": ".google.shopping.merchant.accounts.v1beta.Homepage" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Homepage", - "client": { - "shortName": "HomepageServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageServiceClient" - }, - "method": { - "shortName": "UpdateHomepage", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.UpdateHomepage", - "service": { - "shortName": "HomepageService", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_HomepageService_ClaimHomepage_async", - "title": "AccountIssueService claimHomepage Sample", - "origin": "API_DEFINITION", - "description": " Claims a store's homepage. Executing this method requires admin access. If the homepage is already claimed, this will recheck the verification (unless the merchant is exempted from claiming, which also exempts from verification) and return a successful response. If ownership can no longer be verified, it will return an error, but it won't clear the claim. In case of failure, a canonical error message will be returned: * PERMISSION_DENIED: user doesn't have the necessary permissions on this MC account; * FAILED_PRECONDITION: - The account is not a Merchant Center account; - MC account doesn't have a homepage; - claiming failed (in this case the error message will contain more details).", - "canonical": true, - "file": "homepage_service.claim_homepage.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ClaimHomepage", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.ClaimHomepage", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Homepage", - "client": { - "shortName": "HomepageServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageServiceClient" - }, - "method": { - "shortName": "ClaimHomepage", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.ClaimHomepage", - "service": { - "shortName": "HomepageService", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_HomepageService_UnclaimHomepage_async", - "title": "AccountIssueService unclaimHomepage Sample", - "origin": "API_DEFINITION", - "description": " Unclaims a store's homepage. Executing this method requires admin access.", - "canonical": true, - "file": "homepage_service.unclaim_homepage.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UnclaimHomepage", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.UnclaimHomepage", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Homepage", - "client": { - "shortName": "HomepageServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageServiceClient" - }, - "method": { - "shortName": "UnclaimHomepage", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService.UnclaimHomepage", - "service": { - "shortName": "HomepageService", - "fullName": "google.shopping.merchant.accounts.v1beta.HomepageService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_OnlineReturnPolicyService_GetOnlineReturnPolicy_async", - "title": "AccountIssueService getOnlineReturnPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets an existing return policy.", - "canonical": true, - "file": "online_return_policy_service.get_online_return_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetOnlineReturnPolicy", - "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.GetOnlineReturnPolicy", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy", - "client": { - "shortName": "OnlineReturnPolicyServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyServiceClient" - }, - "method": { - "shortName": "GetOnlineReturnPolicy", - "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.GetOnlineReturnPolicy", - "service": { - "shortName": "OnlineReturnPolicyService", - "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_OnlineReturnPolicyService_ListOnlineReturnPolicies_async", - "title": "AccountIssueService listOnlineReturnPolicies Sample", - "origin": "API_DEFINITION", - "description": " Lists all existing return policies.", - "canonical": true, - "file": "online_return_policy_service.list_online_return_policies.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListOnlineReturnPolicies", - "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.ListOnlineReturnPolicies", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse", - "client": { - "shortName": "OnlineReturnPolicyServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyServiceClient" - }, - "method": { - "shortName": "ListOnlineReturnPolicies", - "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService.ListOnlineReturnPolicies", - "service": { - "shortName": "OnlineReturnPolicyService", - "fullName": "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_ProgramsService_GetProgram_async", - "title": "AccountIssueService getProgram Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the specified program for the account.", - "canonical": true, - "file": "programs_service.get_program.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetProgram", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.GetProgram", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Program", - "client": { - "shortName": "ProgramsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsServiceClient" - }, - "method": { - "shortName": "GetProgram", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.GetProgram", - "service": { - "shortName": "ProgramsService", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_ProgramsService_ListPrograms_async", - "title": "AccountIssueService listPrograms Sample", - "origin": "API_DEFINITION", - "description": " Retrieves all programs for the account.", - "canonical": true, - "file": "programs_service.list_programs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListPrograms", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.ListPrograms", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ListProgramsResponse", - "client": { - "shortName": "ProgramsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsServiceClient" - }, - "method": { - "shortName": "ListPrograms", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.ListPrograms", - "service": { - "shortName": "ProgramsService", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_ProgramsService_EnableProgram_async", - "title": "AccountIssueService enableProgram Sample", - "origin": "API_DEFINITION", - "description": " Enable participation in the specified program for the account. Executing this method requires admin access.", - "canonical": true, - "file": "programs_service.enable_program.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EnableProgram", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.EnableProgram", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Program", - "client": { - "shortName": "ProgramsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsServiceClient" - }, - "method": { - "shortName": "EnableProgram", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.EnableProgram", - "service": { - "shortName": "ProgramsService", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_ProgramsService_DisableProgram_async", - "title": "AccountIssueService disableProgram Sample", - "origin": "API_DEFINITION", - "description": " Disable participation in the specified program for the account. Executing this method requires admin access.", - "canonical": true, - "file": "programs_service.disable_program.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DisableProgram", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.DisableProgram", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Program", - "client": { - "shortName": "ProgramsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsServiceClient" - }, - "method": { - "shortName": "DisableProgram", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService.DisableProgram", - "service": { - "shortName": "ProgramsService", - "fullName": "google.shopping.merchant.accounts.v1beta.ProgramsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_RegionsService_GetRegion_async", - "title": "AccountIssueService getRegion Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a region defined in your Merchant Center account.", - "canonical": true, - "file": "regions_service.get_region.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetRegion", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.GetRegion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Region", - "client": { - "shortName": "RegionsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" - }, - "method": { - "shortName": "GetRegion", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.GetRegion", - "service": { - "shortName": "RegionsService", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_RegionsService_CreateRegion_async", - "title": "AccountIssueService createRegion Sample", - "origin": "API_DEFINITION", - "description": " Creates a region definition in your Merchant Center account. Executing this method requires admin access.", - "canonical": true, - "file": "regions_service.create_region.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateRegion", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.CreateRegion", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "region_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": ".google.shopping.merchant.accounts.v1beta.Region" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Region", - "client": { - "shortName": "RegionsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" - }, - "method": { - "shortName": "CreateRegion", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.CreateRegion", - "service": { - "shortName": "RegionsService", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_RegionsService_UpdateRegion_async", - "title": "AccountIssueService updateRegion Sample", - "origin": "API_DEFINITION", - "description": " Updates a region definition in your Merchant Center account. Executing this method requires admin access.", - "canonical": true, - "file": "regions_service.update_region.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateRegion", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.UpdateRegion", - "async": true, - "parameters": [ - { - "name": "region", - "type": ".google.shopping.merchant.accounts.v1beta.Region" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.Region", - "client": { - "shortName": "RegionsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" - }, - "method": { - "shortName": "UpdateRegion", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.UpdateRegion", - "service": { - "shortName": "RegionsService", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_RegionsService_DeleteRegion_async", - "title": "AccountIssueService deleteRegion Sample", - "origin": "API_DEFINITION", - "description": " Deletes a region definition from your Merchant Center account. Executing this method requires admin access.", - "canonical": true, - "file": "regions_service.delete_region.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteRegion", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.DeleteRegion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RegionsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" - }, - "method": { - "shortName": "DeleteRegion", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.DeleteRegion", - "service": { - "shortName": "RegionsService", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_RegionsService_ListRegions_async", - "title": "AccountIssueService listRegions Sample", - "origin": "API_DEFINITION", - "description": " Lists the regions in your Merchant Center account.", - "canonical": true, - "file": "regions_service.list_regions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRegions", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.ListRegions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ListRegionsResponse", - "client": { - "shortName": "RegionsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsServiceClient" - }, - "method": { - "shortName": "ListRegions", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService.ListRegions", - "service": { - "shortName": "RegionsService", - "fullName": "google.shopping.merchant.accounts.v1beta.RegionsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_ShippingSettingsService_GetShippingSettings_async", - "title": "AccountIssueService getShippingSettings Sample", - "origin": "API_DEFINITION", - "description": " Retrieve shipping setting information.", - "canonical": true, - "file": "shipping_settings_service.get_shipping_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetShippingSettings", - "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService.GetShippingSettings", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ShippingSettings", - "client": { - "shortName": "ShippingSettingsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsServiceClient" - }, - "method": { - "shortName": "GetShippingSettings", - "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService.GetShippingSettings", - "service": { - "shortName": "ShippingSettingsService", - "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_ShippingSettingsService_InsertShippingSettings_async", - "title": "AccountIssueService insertShippingSettings Sample", - "origin": "API_DEFINITION", - "description": " Replace the shipping setting of a merchant with the request shipping setting. Executing this method requires admin access.", - "canonical": true, - "file": "shipping_settings_service.insert_shipping_settings.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InsertShippingSettings", - "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService.InsertShippingSettings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "shipping_setting", - "type": ".google.shopping.merchant.accounts.v1beta.ShippingSettings" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ShippingSettings", - "client": { - "shortName": "ShippingSettingsServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsServiceClient" - }, - "method": { - "shortName": "InsertShippingSettings", - "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService.InsertShippingSettings", - "service": { - "shortName": "ShippingSettingsService", - "fullName": "google.shopping.merchant.accounts.v1beta.ShippingSettingsService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_GetTermsOfServiceAgreementState_async", - "title": "AccountIssueService getTermsOfServiceAgreementState Sample", - "origin": "API_DEFINITION", - "description": " Returns the state of a terms of service agreement.", - "canonical": true, - "file": "terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTermsOfServiceAgreementState", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.GetTermsOfServiceAgreementState", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState", - "client": { - "shortName": "TermsOfServiceAgreementStateServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateServiceClient" - }, - "method": { - "shortName": "GetTermsOfServiceAgreementState", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.GetTermsOfServiceAgreementState", - "service": { - "shortName": "TermsOfServiceAgreementStateService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_RetrieveForApplicationTermsOfServiceAgreementState_async", - "title": "AccountIssueService retrieveForApplicationTermsOfServiceAgreementState Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the state of the agreement for the application terms of service.", - "canonical": true, - "file": "terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RetrieveForApplicationTermsOfServiceAgreementState", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.RetrieveForApplicationTermsOfServiceAgreementState", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState", - "client": { - "shortName": "TermsOfServiceAgreementStateServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateServiceClient" - }, - "method": { - "shortName": "RetrieveForApplicationTermsOfServiceAgreementState", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService.RetrieveForApplicationTermsOfServiceAgreementState", - "service": { - "shortName": "TermsOfServiceAgreementStateService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_TermsOfServiceService_GetTermsOfService_async", - "title": "AccountIssueService getTermsOfService Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the `TermsOfService` associated with the provided version.", - "canonical": true, - "file": "terms_of_service_service.get_terms_of_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTermsOfService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.GetTermsOfService", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.TermsOfService", - "client": { - "shortName": "TermsOfServiceServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceServiceClient" - }, - "method": { - "shortName": "GetTermsOfService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.GetTermsOfService", - "service": { - "shortName": "TermsOfServiceService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_async", - "title": "AccountIssueService retrieveLatestTermsOfService Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the latest version of the `TermsOfService` for a given `kind` and `region_code`.", - "canonical": true, - "file": "terms_of_service_service.retrieve_latest_terms_of_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RetrieveLatestTermsOfService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.RetrieveLatestTermsOfService", - "async": true, - "parameters": [ - { - "name": "region_code", - "type": "TYPE_STRING" - }, - { - "name": "kind", - "type": ".google.shopping.merchant.accounts.v1beta.TermsOfServiceKind" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.TermsOfService", - "client": { - "shortName": "TermsOfServiceServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceServiceClient" - }, - "method": { - "shortName": "RetrieveLatestTermsOfService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.RetrieveLatestTermsOfService", - "service": { - "shortName": "TermsOfServiceService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_TermsOfServiceService_AcceptTermsOfService_async", - "title": "AccountIssueService acceptTermsOfService Sample", - "origin": "API_DEFINITION", - "description": " Accepts a `TermsOfService`. Executing this method requires admin access.", - "canonical": true, - "file": "terms_of_service_service.accept_terms_of_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AcceptTermsOfService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.AcceptTermsOfService", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "account", - "type": "TYPE_STRING" - }, - { - "name": "region_code", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "TermsOfServiceServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceServiceClient" - }, - "method": { - "shortName": "AcceptTermsOfService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService.AcceptTermsOfService", - "service": { - "shortName": "TermsOfServiceService", - "fullName": "google.shopping.merchant.accounts.v1beta.TermsOfServiceService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_UserService_GetUser_async", - "title": "AccountIssueService getUser Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a Merchant Center account user.", - "canonical": true, - "file": "user_service.get_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetUser", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.GetUser", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.User", - "client": { - "shortName": "UserServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" - }, - "method": { - "shortName": "GetUser", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.GetUser", - "service": { - "shortName": "UserService", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_UserService_CreateUser_async", - "title": "AccountIssueService createUser Sample", - "origin": "API_DEFINITION", - "description": " Creates a Merchant Center account user. Executing this method requires admin access.", - "canonical": true, - "file": "user_service.create_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateUser", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.CreateUser", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "user_id", - "type": "TYPE_STRING" - }, - { - "name": "user", - "type": ".google.shopping.merchant.accounts.v1beta.User" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.User", - "client": { - "shortName": "UserServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" - }, - "method": { - "shortName": "CreateUser", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.CreateUser", - "service": { - "shortName": "UserService", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_UserService_DeleteUser_async", - "title": "AccountIssueService deleteUser Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Merchant Center account user. Executing this method requires admin access.", - "canonical": true, - "file": "user_service.delete_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteUser", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.DeleteUser", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "UserServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" - }, - "method": { - "shortName": "DeleteUser", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.DeleteUser", - "service": { - "shortName": "UserService", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_UserService_UpdateUser_async", - "title": "AccountIssueService updateUser Sample", - "origin": "API_DEFINITION", - "description": " Updates a Merchant Center account user. Executing this method requires admin access.", - "canonical": true, - "file": "user_service.update_user.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateUser", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.UpdateUser", - "async": true, - "parameters": [ - { - "name": "user", - "type": ".google.shopping.merchant.accounts.v1beta.User" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.User", - "client": { - "shortName": "UserServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" - }, - "method": { - "shortName": "UpdateUser", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.UpdateUser", - "service": { - "shortName": "UserService", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService" - } - } - } - }, - { - "regionTag": "merchantapi_v1beta_generated_UserService_ListUsers_async", - "title": "AccountIssueService listUsers Sample", - "origin": "API_DEFINITION", - "description": " Lists all users of a Merchant Center account.", - "canonical": true, - "file": "user_service.list_users.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListUsers", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.ListUsers", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.shopping.merchant.accounts.v1beta.ListUsersResponse", - "client": { - "shortName": "UserServiceClient", - "fullName": "google.shopping.merchant.accounts.v1beta.UserServiceClient" - }, - "method": { - "shortName": "ListUsers", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService.ListUsers", - "service": { - "shortName": "UserService", - "fullName": "google.shopping.merchant.accounts.v1beta.UserService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js deleted file mode 100644 index 6a61dbac5ec..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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_TermsOfServiceAgreementStateService_GetTermsOfServiceAgreementState_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 terms of service version. - * Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` - * The identifier format is: `{TermsOfServiceKind}-{country}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {TermsOfServiceAgreementStateServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new TermsOfServiceAgreementStateServiceClient(); - - async function callGetTermsOfServiceAgreementState() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getTermsOfServiceAgreementState(request); - console.log(response); - } - - callGetTermsOfServiceAgreementState(); - // [END merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_GetTermsOfServiceAgreementState_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js deleted file mode 100644 index c3cf9b1f147..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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(parent) { - // [START merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_RetrieveForApplicationTermsOfServiceAgreementState_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The account for which to get a TermsOfServiceAgreementState - * Format: `accounts/{account}` - */ - // const parent = 'abc123' - - // Imports the Accounts library - const {TermsOfServiceAgreementStateServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new TermsOfServiceAgreementStateServiceClient(); - - async function callRetrieveForApplicationTermsOfServiceAgreementState() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await accountsClient.retrieveForApplicationTermsOfServiceAgreementState(request); - console.log(response); - } - - callRetrieveForApplicationTermsOfServiceAgreementState(); - // [END merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_RetrieveForApplicationTermsOfServiceAgreementState_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js deleted file mode 100644 index 0184b6cc553..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js +++ /dev/null @@ -1,74 +0,0 @@ -// 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, account, regionCode) { - // [START merchantapi_v1beta_generated_TermsOfServiceService_AcceptTermsOfService_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 terms of service version. - * Format: `termsOfService/{version}` - */ - // const name = 'abc123' - /** - * Required. The account for which to accept the ToS. - */ - // const account = 'abc123' - /** - * 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' - - // Imports the Accounts library - const {TermsOfServiceServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new TermsOfServiceServiceClient(); - - async function callAcceptTermsOfService() { - // Construct request - const request = { - name, - account, - regionCode, - }; - - // Run request - const response = await accountsClient.acceptTermsOfService(request); - console.log(response); - } - - callAcceptTermsOfService(); - // [END merchantapi_v1beta_generated_TermsOfServiceService_AcceptTermsOfService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.get_terms_of_service.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.get_terms_of_service.js deleted file mode 100644 index 3984f47f00f..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.get_terms_of_service.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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_TermsOfServiceService_GetTermsOfService_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 terms of service version. - * Format: `termsOfService/{version}` - */ - // const name = 'abc123' - - // Imports the Accounts library - const {TermsOfServiceServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new TermsOfServiceServiceClient(); - - async function callGetTermsOfService() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getTermsOfService(request); - console.log(response); - } - - callGetTermsOfService(); - // [END merchantapi_v1beta_generated_TermsOfServiceService_GetTermsOfService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js deleted file mode 100644 index b7ad2cd0eb2..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/terms_of_service_service.retrieve_latest_terms_of_service.js +++ /dev/null @@ -1,68 +0,0 @@ -// 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(regionCode, kind) { - // [START merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_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. 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' - /** - * Required. The Kind this terms of service version applies to. - */ - // const kind = {} - - // Imports the Accounts library - const {TermsOfServiceServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new TermsOfServiceServiceClient(); - - async function callRetrieveLatestTermsOfService() { - // Construct request - const request = { - regionCode, - kind, - }; - - // Run request - const response = await accountsClient.retrieveLatestTermsOfService(request); - console.log(response); - } - - callRetrieveLatestTermsOfService(); - // [END merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.create_user.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.create_user.js deleted file mode 100644 index 43b6ed175f1..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.create_user.js +++ /dev/null @@ -1,73 +0,0 @@ -// 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(parent, userId, user) { - // [START merchantapi_v1beta_generated_UserService_CreateUser_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 account for which a user will be - * created. Format: `accounts/{account}` - */ - // const parent = 'abc123' - /** - * Required. The email address of the user (for example, - * `john.doe@gmail.com`). - */ - // const userId = 'abc123' - /** - * Required. The user to create. - */ - // const user = {} - - // Imports the Accounts library - const {UserServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new UserServiceClient(); - - async function callCreateUser() { - // Construct request - const request = { - parent, - userId, - user, - }; - - // Run request - const response = await accountsClient.createUser(request); - console.log(response); - } - - callCreateUser(); - // [END merchantapi_v1beta_generated_UserService_CreateUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.delete_user.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.delete_user.js deleted file mode 100644 index 62b5922a212..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.delete_user.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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_UserService_DeleteUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the user to delete. - * Format: `accounts/{account}/users/{email}` - * It is also possible to delete the user corresponding to the caller by using - * `me` rather than an email address as in `accounts/{account}/users/me`. - */ - // const name = 'abc123' - - // Imports the Accounts library - const {UserServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new UserServiceClient(); - - async function callDeleteUser() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.deleteUser(request); - console.log(response); - } - - callDeleteUser(); - // [END merchantapi_v1beta_generated_UserService_DeleteUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.get_user.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.get_user.js deleted file mode 100644 index 8ae9ba97ce7..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.get_user.js +++ /dev/null @@ -1,65 +0,0 @@ -// 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_UserService_GetUser_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The name of the user to retrieve. - * Format: `accounts/{account}/users/{email}` - * It is also possible to retrieve the user corresponding to the caller by - * using `me` rather than an email address as in - * `accounts/{account}/users/me`. - */ - // const name = 'abc123' - - // Imports the Accounts library - const {UserServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new UserServiceClient(); - - async function callGetUser() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await accountsClient.getUser(request); - console.log(response); - } - - callGetUser(); - // [END merchantapi_v1beta_generated_UserService_GetUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.list_users.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.list_users.js deleted file mode 100644 index f47703e3006..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.list_users.js +++ /dev/null @@ -1,77 +0,0 @@ -// 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(parent) { - // [START merchantapi_v1beta_generated_UserService_ListUsers_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns this collection of users. - * Format: `accounts/{account}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of users to return. The service may return - * fewer than this value. If unspecified, at most 50 users will be returned. - * The maximum value is 100; values above 100 will be coerced to 100 - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListUsers` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListUsers` must match - * the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Accounts library - const {UserServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new UserServiceClient(); - - async function callListUsers() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = accountsClient.listUsersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListUsers(); - // [END merchantapi_v1beta_generated_UserService_ListUsers_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.update_user.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.update_user.js deleted file mode 100644 index cbd950921ef..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/user_service.update_user.js +++ /dev/null @@ -1,68 +0,0 @@ -// 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(user, updateMask) { - // [START merchantapi_v1beta_generated_UserService_UpdateUser_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 user. - * Use `me` to refer to your own email address, for example - * `accounts/{account}/users/me`. - */ - // const user = {} - /** - * Required. List of fields being updated. - */ - // const updateMask = {} - - // Imports the Accounts library - const {UserServiceClient} = require('@google-shopping/accounts').v1beta; - - // Instantiates a client - const accountsClient = new UserServiceClient(); - - async function callUpdateUser() { - // Construct request - const request = { - user, - updateMask, - }; - - // Run request - const response = await accountsClient.updateUser(request); - console.log(response); - } - - callUpdateUser(); - // [END merchantapi_v1beta_generated_UserService_UpdateUser_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/index.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/index.ts deleted file mode 100644 index 48b246a3834..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/index.ts +++ /dev/null @@ -1,53 +0,0 @@ -// 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 v1beta from './v1beta'; -const AccountIssueServiceClient = v1beta.AccountIssueServiceClient; -type AccountIssueServiceClient = v1beta.AccountIssueServiceClient; -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; -type BusinessInfoServiceClient = v1beta.BusinessInfoServiceClient; -const EmailPreferencesServiceClient = v1beta.EmailPreferencesServiceClient; -type EmailPreferencesServiceClient = v1beta.EmailPreferencesServiceClient; -const HomepageServiceClient = v1beta.HomepageServiceClient; -type HomepageServiceClient = v1beta.HomepageServiceClient; -const OnlineReturnPolicyServiceClient = v1beta.OnlineReturnPolicyServiceClient; -type OnlineReturnPolicyServiceClient = v1beta.OnlineReturnPolicyServiceClient; -const ProgramsServiceClient = v1beta.ProgramsServiceClient; -type ProgramsServiceClient = v1beta.ProgramsServiceClient; -const RegionsServiceClient = v1beta.RegionsServiceClient; -type RegionsServiceClient = v1beta.RegionsServiceClient; -const ShippingSettingsServiceClient = v1beta.ShippingSettingsServiceClient; -type ShippingSettingsServiceClient = v1beta.ShippingSettingsServiceClient; -const TermsOfServiceAgreementStateServiceClient = v1beta.TermsOfServiceAgreementStateServiceClient; -type TermsOfServiceAgreementStateServiceClient = v1beta.TermsOfServiceAgreementStateServiceClient; -const TermsOfServiceServiceClient = v1beta.TermsOfServiceServiceClient; -type TermsOfServiceServiceClient = v1beta.TermsOfServiceServiceClient; -const UserServiceClient = v1beta.UserServiceClient; -type UserServiceClient = v1beta.UserServiceClient; -export {v1beta, AccountIssueServiceClient, AccountsServiceClient, AccountTaxServiceClient, AutofeedSettingsServiceClient, BusinessIdentityServiceClient, BusinessInfoServiceClient, EmailPreferencesServiceClient, HomepageServiceClient, OnlineReturnPolicyServiceClient, ProgramsServiceClient, RegionsServiceClient, ShippingSettingsServiceClient, TermsOfServiceAgreementStateServiceClient, TermsOfServiceServiceClient, UserServiceClient}; -export default {v1beta, AccountIssueServiceClient, AccountsServiceClient, AccountTaxServiceClient, AutofeedSettingsServiceClient, BusinessIdentityServiceClient, BusinessInfoServiceClient, EmailPreferencesServiceClient, HomepageServiceClient, OnlineReturnPolicyServiceClient, ProgramsServiceClient, RegionsServiceClient, ShippingSettingsServiceClient, TermsOfServiceAgreementStateServiceClient, TermsOfServiceServiceClient, UserServiceClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client.ts deleted file mode 100644 index 2d4ace6d15e..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client.ts +++ /dev/null @@ -1,1065 +0,0 @@ -// 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, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1beta/account_issue_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './account_issue_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to support `AccountIssueService` API. - * @class - * @memberof v1beta - */ -export class AccountIssueServiceClient { - 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}; - accountIssueServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AccountIssueServiceClient. - * - * @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 AccountIssueServiceClient({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 AccountIssueServiceClient; - 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}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listAccountIssues: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accountIssues') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.shopping.merchant.accounts.v1beta.AccountIssueService', 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.accountIssueServiceStub) { - return this.accountIssueServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.AccountIssueService. - this.accountIssueServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.AccountIssueService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.AccountIssueService, - 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 accountIssueServiceStubMethods = - ['listAccountIssues']; - for (const methodName of accountIssueServiceStubMethods) { - const callPromise = this.accountIssueServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.accountIssueServiceStub; - } - - /** - * 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 -- - // ------------------- - - /** - * Lists all account issues of a Merchant Center account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of issues. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of issues to return. The service may return - * fewer than this value. If unspecified, at most 50 users will be returned. - * The maximum value is 100; values above 100 will be coerced to 100 - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAccountIssues` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAccountIssues` must - * match the call that provided the page token. - * @param {string} [request.languageCode] - * Optional. The issues in the response will have human-readable fields in the - * 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 {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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.AccountIssue|AccountIssue}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listAccountIssuesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAccountIssues( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[], - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse - ]>; - listAccountIssues( - request: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccountIssue>): void; - listAccountIssues( - request: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccountIssue>): void; - listAccountIssues( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccountIssue>, - callback?: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccountIssue>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[], - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listAccountIssues(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of issues. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of issues to return. The service may return - * fewer than this value. If unspecified, at most 50 users will be returned. - * The maximum value is 100; values above 100 will be coerced to 100 - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAccountIssues` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAccountIssues` must - * match the call that provided the page token. - * @param {string} [request.languageCode] - * Optional. The issues in the response will have human-readable fields in the - * 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 {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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.AccountIssue|AccountIssue} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listAccountIssuesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAccountIssuesStream( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAccountIssues']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccountIssues.createStream( - this.innerApiCalls.listAccountIssues as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAccountIssues`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of issues. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of issues to return. The service may return - * fewer than this value. If unspecified, at most 50 users will be returned. - * The maximum value is 100; values above 100 will be coerced to 100 - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAccountIssues` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAccountIssues` must - * match the call that provided the page token. - * @param {string} [request.languageCode] - * Optional. The issues in the response will have human-readable fields in the - * 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 {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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.shopping.merchant.accounts.v1beta.AccountIssue|AccountIssue}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/account_issue_service.list_account_issues.js - * region_tag:merchantapi_v1beta_generated_AccountIssueService_ListAccountIssues_async - */ - listAccountIssuesAsync( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountIssuesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAccountIssues']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccountIssues.asyncIterate( - this.innerApiCalls['listAccountIssues'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- 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.accountIssueServiceStub && !this._terminated) { - return this.accountIssueServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client_config.json deleted file mode 100644 index 3c6eab21940..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_client_config.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.AccountIssueService": { - "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": { - "ListAccountIssues": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_issue_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client.ts deleted file mode 100644 index ef5db4fa63e..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client.ts +++ /dev/null @@ -1,1172 +0,0 @@ -// 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, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1beta/account_tax_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './account_tax_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Manages account level tax setting data. - * - * This API defines the following resource model: - * - * - {@link protos.google.shopping.merchant.accounts.v1main.AccountTax|AccountTax} - * @class - * @memberof v1beta - */ -export class AccountTaxServiceClient { - 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}; - accountTaxServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AccountTaxServiceClient. - * - * @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 AccountTaxServiceClient({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 AccountTaxServiceClient; - 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}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listAccountTax: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accountTaxes') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.shopping.merchant.accounts.v1beta.AccountTaxService', 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.accountTaxServiceStub) { - return this.accountTaxServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.AccountTaxService. - this.accountTaxServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.AccountTaxService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.AccountTaxService, - 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 accountTaxServiceStubMethods = - ['getAccountTax', 'listAccountTax', 'updateAccountTax']; - for (const methodName of accountTaxServiceStubMethods) { - const callPromise = this.accountTaxServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.accountTaxServiceStub; - } - - /** - * 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 -- - // ------------------- -/** - * Returns the tax rules that match the conditions of GetAccountTaxRequest - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name from which tax settings will be retrieved - * @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.AccountTax|AccountTax}. - * 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/account_tax_service.get_account_tax.js - * region_tag:merchantapi_v1beta_generated_AccountTaxService_GetAccountTax_async - */ - getAccountTax( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|undefined, {}|undefined - ]>; - getAccountTax( - request: protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|null|undefined, - {}|null|undefined>): void; - getAccountTax( - request: protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|null|undefined, - {}|null|undefined>): void; - getAccountTax( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountTaxRequest|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.getAccountTax(request, options, callback); - } -/** - * Updates the tax settings of the account. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.shopping.merchant.accounts.v1beta.AccountTax} request.accountTax - * Required. The tax setting that will be updated - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be 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.AccountTax|AccountTax}. - * 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/account_tax_service.update_account_tax.js - * region_tag:merchantapi_v1beta_generated_AccountTaxService_UpdateAccountTax_async - */ - updateAccountTax( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|undefined, {}|undefined - ]>; - updateAccountTax( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|null|undefined, - {}|null|undefined>): void; - updateAccountTax( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|null|undefined, - {}|null|undefined>): void; - updateAccountTax( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccountTax, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountTaxRequest|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({ - 'account_tax.name': request.accountTax!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateAccountTax(request, options, callback); - } - - /** - * Lists the tax settings of the sub-accounts only in your - * Merchant Center account. - * This method can only be called on a multi-client account, otherwise it'll - * return an error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of account tax. - * Format: accounts/{account} - * @param {number} request.pageSize - * The maximum number of tax settings to return in the response, used for - * paging. - * @param {string} request.pageToken - * The token returned by the previous request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.AccountTax|AccountTax}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listAccountTaxAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAccountTax( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccountTax[], - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse - ]>; - listAccountTax( - request: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccountTax>): void; - listAccountTax( - request: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccountTax>): void; - listAccountTax( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccountTax>, - callback?: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccountTax>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccountTax[], - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listAccountTax(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of account tax. - * Format: accounts/{account} - * @param {number} request.pageSize - * The maximum number of tax settings to return in the response, used for - * paging. - * @param {string} request.pageToken - * The token returned by the previous request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.AccountTax|AccountTax} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listAccountTaxAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAccountTaxStream( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAccountTax']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccountTax.createStream( - this.innerApiCalls.listAccountTax as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAccountTax`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of account tax. - * Format: accounts/{account} - * @param {number} request.pageSize - * The maximum number of tax settings to return in the response, used for - * paging. - * @param {string} request.pageToken - * The token returned by the previous request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.shopping.merchant.accounts.v1beta.AccountTax|AccountTax}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/account_tax_service.list_account_tax.js - * region_tag:merchantapi_v1beta_generated_AccountTaxService_ListAccountTax_async - */ - listAccountTaxAsync( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountTaxRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listAccountTax']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccountTax.asyncIterate( - this.innerApiCalls['listAccountTax'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- 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.accountTaxServiceStub && !this._terminated) { - return this.accountTaxServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client_config.json deleted file mode 100644 index 4f2807b57b2..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_client_config.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.AccountTaxService": { - "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": { - "GetAccountTax": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListAccountTax": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateAccountTax": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/account_tax_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client.ts deleted file mode 100644 index f63e55a8e0c..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client.ts +++ /dev/null @@ -1,1527 +0,0 @@ -// 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, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1beta/accounts_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './accounts_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to support Accounts API. - * @class - * @memberof v1beta - */ -export class AccountsServiceClient { - 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}; - accountsServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AccountsServiceClient. - * - * @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 AccountsServiceClient({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 AccountsServiceClient; - 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}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listAccounts: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accounts'), - listSubAccounts: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'accounts') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.shopping.merchant.accounts.v1beta.AccountsService', 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.accountsServiceStub) { - return this.accountsServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.AccountsService. - this.accountsServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.AccountsService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.AccountsService, - 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 accountsServiceStubMethods = - ['getAccount', 'createAndConfigureAccount', 'deleteAccount', 'updateAccount', 'listAccounts', 'listSubAccounts']; - for (const methodName of accountsServiceStubMethods) { - const callPromise = this.accountsServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.accountsServiceStub; - } - - /** - * 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 an account from your Merchant Center account. - * After inserting, updating, or deleting an account, it may take several - * minutes before changes take effect. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the account to retrieve. - * Format: `accounts/{account}` - * @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.Account|Account}. - * 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/accounts_service.get_account.js - * region_tag:merchantapi_v1beta_generated_AccountsService_GetAccount_async - */ - getAccount( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|undefined, {}|undefined - ]>; - getAccount( - request: protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|null|undefined, - {}|null|undefined>): void; - getAccount( - request: protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|null|undefined, - {}|null|undefined>): void; - getAccount( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IGetAccountRequest|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.getAccount(request, options, callback); - } -/** - * Creates a standalone Merchant Center account with additional configuration. - * Adds the user that makes the request as an admin for the new account. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.shopping.merchant.accounts.v1beta.Account} request.account - * Required. The account to be created. - * @param {number[]} [request.users] - * Optional. Users to be added to the account. - * @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 - * 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. - * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. - * 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/accounts_service.create_and_configure_account.js - * region_tag:merchantapi_v1beta_generated_AccountsService_CreateAndConfigureAccount_async - */ - createAndConfigureAccount( - request?: protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|undefined, {}|undefined - ]>; - createAndConfigureAccount( - request: protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|null|undefined, - {}|null|undefined>): void; - createAndConfigureAccount( - request: protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|null|undefined, - {}|null|undefined>): void; - createAndConfigureAccount( - request?: protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.ICreateAndConfigureAccountRequest|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 || {}; - this.initialize(); - return this.innerApiCalls.createAndConfigureAccount(request, options, callback); - } -/** - * Deletes the specified account regardless of its type: standalone, MCA or - * sub-account. Deleting an MCA leads to the deletion of all of its - * sub-accounts. Executing this method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the account to delete. - * Format: `accounts/{account}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/accounts_service.delete_account.js - * region_tag:merchantapi_v1beta_generated_AccountsService_DeleteAccount_async - */ - deleteAccount( - request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|undefined, {}|undefined - ]>; - deleteAccount( - request: protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|null|undefined, - {}|null|undefined>): void; - deleteAccount( - request: protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|null|undefined, - {}|null|undefined>): void; - deleteAccount( - request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteAccountRequest|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.deleteAccount(request, options, callback); - } -/** - * Updates an account regardless of its type: standalone, MCA or sub-account. - * Executing this method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.shopping.merchant.accounts.v1beta.Account} request.account - * Required. The new version of the account. - * @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.Account|Account}. - * 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/accounts_service.update_account.js - * region_tag:merchantapi_v1beta_generated_AccountsService_UpdateAccount_async - */ - updateAccount( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|undefined, {}|undefined - ]>; - updateAccount( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|null|undefined, - {}|null|undefined>): void; - updateAccount( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|null|undefined, - {}|null|undefined>): void; - updateAccount( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount, - protos.google.shopping.merchant.accounts.v1beta.IUpdateAccountRequest|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({ - 'account.name': request.account!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateAccount(request, options, callback); - } - - /** - * Lists accounts accessible to the calling user and matching the - * constraints of the request such as page size or filters. - * This is not just listing the sub-accounts of an MCA, but all accounts the - * calling user has access to including other MCAs, linked accounts, - * standalone accounts and so on. - * - * @param {Object} request - * The request object that will be sent. - * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 250 accounts are returned. - * The maximum value is 500; values above 500 are coerced to 500. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAccounts` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. Returns only accounts that match the - * [filter](/merchant/api/guides/accounts/filter). - * For more details, see the - * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listAccountsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAccounts( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount[], - protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse - ]>; - listAccounts( - request: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccount>): void; - listAccounts( - request: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccount>): void; - listAccounts( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccount>, - callback?: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccount>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount[], - protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListAccountsResponse - ]>|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 || {}; - this.initialize(); - return this.innerApiCalls.listAccounts(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 250 accounts are returned. - * The maximum value is 500; values above 500 are coerced to 500. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAccounts` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. Returns only accounts that match the - * [filter](/merchant/api/guides/accounts/filter). - * For more details, see the - * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listAccountsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listAccountsStream( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listAccounts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccounts.createStream( - this.innerApiCalls.listAccounts as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAccounts`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 250 accounts are returned. - * The maximum value is 500; values above 500 are coerced to 500. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAccounts` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. Returns only accounts that match the - * [filter](/merchant/api/guides/accounts/filter). - * For more details, see the - * [filter syntax reference](/merchant/api/guides/accounts/filter-syntax). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/accounts_service.list_accounts.js - * region_tag:merchantapi_v1beta_generated_AccountsService_ListAccounts_async - */ - listAccountsAsync( - request?: protos.google.shopping.merchant.accounts.v1beta.IListAccountsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - const defaultCallSettings = this._defaults['listAccounts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAccounts.asyncIterate( - this.innerApiCalls['listAccounts'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List all sub-accounts for a given multi client account. This is a - * convenience wrapper for the more powerful `ListAccounts` method. This - * method will produce the same results as calling `ListsAccounts` with the - * following filter: - * `relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.provider - * Required. The parent account. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 250 accounts are returned. - * The maximum value is 500; values above 500 are coerced to 500. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAccounts` must match - * the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSubAccountsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSubAccounts( - request?: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount[], - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse - ]>; - listSubAccounts( - request: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccount>): void; - listSubAccounts( - request: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccount>): void; - listSubAccounts( - request?: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccount>, - callback?: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IAccount>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IAccount[], - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsResponse - ]>|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({ - 'provider': request.provider ?? '', - }); - this.initialize(); - return this.innerApiCalls.listSubAccounts(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.provider - * Required. The parent account. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 250 accounts are returned. - * The maximum value is 500; values above 500 are coerced to 500. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAccounts` must match - * the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSubAccountsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSubAccountsStream( - request?: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'provider': request.provider ?? '', - }); - const defaultCallSettings = this._defaults['listSubAccounts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSubAccounts.createStream( - this.innerApiCalls.listSubAccounts as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSubAccounts`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.provider - * Required. The parent account. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of accounts to return. The service may return - * fewer than this value. If unspecified, at most 250 accounts are returned. - * The maximum value is 500; values above 500 are coerced to 500. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListAccounts` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListAccounts` must match - * the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.shopping.merchant.accounts.v1beta.Account|Account}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/accounts_service.list_sub_accounts.js - * region_tag:merchantapi_v1beta_generated_AccountsService_ListSubAccounts_async - */ - listSubAccountsAsync( - request?: protos.google.shopping.merchant.accounts.v1beta.IListSubAccountsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'provider': request.provider ?? '', - }); - const defaultCallSettings = this._defaults['listSubAccounts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSubAccounts.asyncIterate( - this.innerApiCalls['listSubAccounts'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- 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.accountsServiceStub && !this._terminated) { - return this.accountsServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client_config.json deleted file mode 100644 index 2cfc899d509..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_client_config.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.AccountsService": { - "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": { - "GetAccount": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateAndConfigureAccount": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteAccount": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateAccount": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListAccounts": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListSubAccounts": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/accounts_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client.ts deleted file mode 100644 index 355fbcedc22..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client.ts +++ /dev/null @@ -1,983 +0,0 @@ -// 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/business_identity_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './business_identity_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to support [business - * identity](https://support.google.com/merchants/answer/12564247) API. - * @class - * @memberof v1beta - */ -export class BusinessIdentityServiceClient { - 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}; - businessIdentityServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BusinessIdentityServiceClient. - * - * @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 BusinessIdentityServiceClient({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 BusinessIdentityServiceClient; - 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.BusinessIdentityService', 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.businessIdentityServiceStub) { - return this.businessIdentityServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.BusinessIdentityService. - this.businessIdentityServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.BusinessIdentityService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.BusinessIdentityService, - 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 businessIdentityServiceStubMethods = - ['getBusinessIdentity', 'updateBusinessIdentity']; - for (const methodName of businessIdentityServiceStubMethods) { - const callPromise = this.businessIdentityServiceStub.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.businessIdentityServiceStub; - } - - /** - * 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 business identity of an account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the business identity. - * Format: `accounts/{account}/businessIdentity` - * @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.BusinessIdentity|BusinessIdentity}. - * 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/business_identity_service.get_business_identity.js - * region_tag:merchantapi_v1beta_generated_BusinessIdentityService_GetBusinessIdentity_async - */ - getBusinessIdentity( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|undefined, {}|undefined - ]>; - getBusinessIdentity( - request: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|null|undefined, - {}|null|undefined>): void; - getBusinessIdentity( - request: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|null|undefined, - {}|null|undefined>): void; - getBusinessIdentity( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessIdentityRequest|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.getBusinessIdentity(request, options, callback); - } -/** - * Updates the business identity of an account. Executing this method requires - * admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.shopping.merchant.accounts.v1beta.BusinessIdentity} request.businessIdentity - * Required. The new version of the business identity. - * @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.BusinessIdentity|BusinessIdentity}. - * 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/business_identity_service.update_business_identity.js - * region_tag:merchantapi_v1beta_generated_BusinessIdentityService_UpdateBusinessIdentity_async - */ - updateBusinessIdentity( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|undefined, {}|undefined - ]>; - updateBusinessIdentity( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|null|undefined, - {}|null|undefined>): void; - updateBusinessIdentity( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|null|undefined, - {}|null|undefined>): void; - updateBusinessIdentity( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessIdentityRequest|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({ - 'business_identity.name': request.businessIdentity!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateBusinessIdentity(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.businessIdentityServiceStub && !this._terminated) { - return this.businessIdentityServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client_config.json deleted file mode 100644 index 3f53a2e5cc4..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_client_config.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.BusinessIdentityService": { - "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": { - "GetBusinessIdentity": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateBusinessIdentity": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_identity_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client.ts deleted file mode 100644 index a55478407e8..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client.ts +++ /dev/null @@ -1,982 +0,0 @@ -// 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/business_info_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './business_info_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to support business info API. - * @class - * @memberof v1beta - */ -export class BusinessInfoServiceClient { - 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}; - businessInfoServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BusinessInfoServiceClient. - * - * @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 BusinessInfoServiceClient({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 BusinessInfoServiceClient; - 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.BusinessInfoService', 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.businessInfoServiceStub) { - return this.businessInfoServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.BusinessInfoService. - this.businessInfoServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.BusinessInfoService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.BusinessInfoService, - 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 businessInfoServiceStubMethods = - ['getBusinessInfo', 'updateBusinessInfo']; - for (const methodName of businessInfoServiceStubMethods) { - const callPromise = this.businessInfoServiceStub.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.businessInfoServiceStub; - } - - /** - * 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 business info of an account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the business info. - * Format: `accounts/{account}/businessInfo` - * @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.BusinessInfo|BusinessInfo}. - * 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/business_info_service.get_business_info.js - * region_tag:merchantapi_v1beta_generated_BusinessInfoService_GetBusinessInfo_async - */ - getBusinessInfo( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|undefined, {}|undefined - ]>; - getBusinessInfo( - request: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|null|undefined, - {}|null|undefined>): void; - getBusinessInfo( - request: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|null|undefined, - {}|null|undefined>): void; - getBusinessInfo( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IGetBusinessInfoRequest|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.getBusinessInfo(request, options, callback); - } -/** - * Updates the business info of an account. Executing this method requires - * admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.shopping.merchant.accounts.v1beta.BusinessInfo} request.businessInfo - * Required. The new version of the business info. - * @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.BusinessInfo|BusinessInfo}. - * 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/business_info_service.update_business_info.js - * region_tag:merchantapi_v1beta_generated_BusinessInfoService_UpdateBusinessInfo_async - */ - updateBusinessInfo( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|undefined, {}|undefined - ]>; - updateBusinessInfo( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|null|undefined, - {}|null|undefined>): void; - updateBusinessInfo( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|null|undefined, - {}|null|undefined>): void; - updateBusinessInfo( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo, - protos.google.shopping.merchant.accounts.v1beta.IUpdateBusinessInfoRequest|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({ - 'business_info.name': request.businessInfo!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateBusinessInfo(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.businessInfoServiceStub && !this._terminated) { - return this.businessInfoServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client_config.json deleted file mode 100644 index df02eede533..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_client_config.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.BusinessInfoService": { - "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": { - "GetBusinessInfo": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateBusinessInfo": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/business_info_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client.ts deleted file mode 100644 index 8df5d3a128f..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client.ts +++ /dev/null @@ -1,997 +0,0 @@ -// 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/email_preferences_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './email_preferences_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to support the `EmailPreferences` API. - * - * This service only permits retrieving and updating email preferences for the - * authenticated user. - * @class - * @memberof v1beta - */ -export class EmailPreferencesServiceClient { - 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}; - emailPreferencesServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of EmailPreferencesServiceClient. - * - * @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 EmailPreferencesServiceClient({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 EmailPreferencesServiceClient; - 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.EmailPreferencesService', 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.emailPreferencesServiceStub) { - return this.emailPreferencesServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.EmailPreferencesService. - this.emailPreferencesServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.EmailPreferencesService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.EmailPreferencesService, - 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 emailPreferencesServiceStubMethods = - ['getEmailPreferences', 'updateEmailPreferences']; - for (const methodName of emailPreferencesServiceStubMethods) { - const callPromise = this.emailPreferencesServiceStub.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.emailPreferencesServiceStub; - } - - /** - * 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 -- - // ------------------- -/** - * Returns the email preferences for a Merchant Center account user. - * - * Use the name=accounts/* /users/me/emailPreferences alias to get preferences - * for the authenticated user. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the `EmailPreferences` resource. - * Format: `accounts/{account}/users/{email}/emailPreferences` - * @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.EmailPreferences|EmailPreferences}. - * 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/email_preferences_service.get_email_preferences.js - * region_tag:merchantapi_v1beta_generated_EmailPreferencesService_GetEmailPreferences_async - */ - getEmailPreferences( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|undefined, {}|undefined - ]>; - getEmailPreferences( - request: protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|null|undefined, - {}|null|undefined>): void; - getEmailPreferences( - request: protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|null|undefined, - {}|null|undefined>): void; - getEmailPreferences( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IGetEmailPreferencesRequest|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.getEmailPreferences(request, options, callback); - } -/** - * Updates the email preferences for a Merchant Center account user. MCA users - * should specify the MCA account rather than a sub-account of the MCA. - * - * Preferences which are not explicitly selected in the update mask will not - * be updated. - * - * It is invalid for updates to specify an UNCONFIRMED opt-in status value. - * - * Use the name=accounts/* /users/me/emailPreferences alias to update - * preferences - * for the authenticated user. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.shopping.merchant.accounts.v1beta.EmailPreferences} request.emailPreferences - * Required. Email Preferences to be updated. - * @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.EmailPreferences|EmailPreferences}. - * 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/email_preferences_service.update_email_preferences.js - * region_tag:merchantapi_v1beta_generated_EmailPreferencesService_UpdateEmailPreferences_async - */ - updateEmailPreferences( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|undefined, {}|undefined - ]>; - updateEmailPreferences( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|null|undefined, - {}|null|undefined>): void; - updateEmailPreferences( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|null|undefined, - {}|null|undefined>): void; - updateEmailPreferences( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences, - protos.google.shopping.merchant.accounts.v1beta.IUpdateEmailPreferencesRequest|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({ - 'email_preferences.name': request.emailPreferences!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateEmailPreferences(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.emailPreferencesServiceStub && !this._terminated) { - return this.emailPreferencesServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client_config.json deleted file mode 100644 index e16984f64b8..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_client_config.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.EmailPreferencesService": { - "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": { - "GetEmailPreferences": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateEmailPreferences": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/email_preferences_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/gapic_metadata.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/gapic_metadata.json deleted file mode 100644 index effe3375d06..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/gapic_metadata.json +++ /dev/null @@ -1,701 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.shopping.merchant.accounts.v1beta", - "libraryPackage": "@google-shopping/accounts", - "services": { - "AccountIssueService": { - "clients": { - "grpc": { - "libraryClient": "AccountIssueServiceClient", - "rpcs": { - "ListAccountIssues": { - "methods": [ - "listAccountIssues", - "listAccountIssuesStream", - "listAccountIssuesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AccountIssueServiceClient", - "rpcs": { - "ListAccountIssues": { - "methods": [ - "listAccountIssues", - "listAccountIssuesStream", - "listAccountIssuesAsync" - ] - } - } - } - } - }, - "AccountsService": { - "clients": { - "grpc": { - "libraryClient": "AccountsServiceClient", - "rpcs": { - "GetAccount": { - "methods": [ - "getAccount" - ] - }, - "CreateAndConfigureAccount": { - "methods": [ - "createAndConfigureAccount" - ] - }, - "DeleteAccount": { - "methods": [ - "deleteAccount" - ] - }, - "UpdateAccount": { - "methods": [ - "updateAccount" - ] - }, - "ListAccounts": { - "methods": [ - "listAccounts", - "listAccountsStream", - "listAccountsAsync" - ] - }, - "ListSubAccounts": { - "methods": [ - "listSubAccounts", - "listSubAccountsStream", - "listSubAccountsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AccountsServiceClient", - "rpcs": { - "GetAccount": { - "methods": [ - "getAccount" - ] - }, - "CreateAndConfigureAccount": { - "methods": [ - "createAndConfigureAccount" - ] - }, - "DeleteAccount": { - "methods": [ - "deleteAccount" - ] - }, - "UpdateAccount": { - "methods": [ - "updateAccount" - ] - }, - "ListAccounts": { - "methods": [ - "listAccounts", - "listAccountsStream", - "listAccountsAsync" - ] - }, - "ListSubAccounts": { - "methods": [ - "listSubAccounts", - "listSubAccountsStream", - "listSubAccountsAsync" - ] - } - } - } - } - }, - "AccountTaxService": { - "clients": { - "grpc": { - "libraryClient": "AccountTaxServiceClient", - "rpcs": { - "GetAccountTax": { - "methods": [ - "getAccountTax" - ] - }, - "UpdateAccountTax": { - "methods": [ - "updateAccountTax" - ] - }, - "ListAccountTax": { - "methods": [ - "listAccountTax", - "listAccountTaxStream", - "listAccountTaxAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AccountTaxServiceClient", - "rpcs": { - "GetAccountTax": { - "methods": [ - "getAccountTax" - ] - }, - "UpdateAccountTax": { - "methods": [ - "updateAccountTax" - ] - }, - "ListAccountTax": { - "methods": [ - "listAccountTax", - "listAccountTaxStream", - "listAccountTaxAsync" - ] - } - } - } - } - }, - "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": { - "libraryClient": "BusinessIdentityServiceClient", - "rpcs": { - "GetBusinessIdentity": { - "methods": [ - "getBusinessIdentity" - ] - }, - "UpdateBusinessIdentity": { - "methods": [ - "updateBusinessIdentity" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BusinessIdentityServiceClient", - "rpcs": { - "GetBusinessIdentity": { - "methods": [ - "getBusinessIdentity" - ] - }, - "UpdateBusinessIdentity": { - "methods": [ - "updateBusinessIdentity" - ] - } - } - } - } - }, - "BusinessInfoService": { - "clients": { - "grpc": { - "libraryClient": "BusinessInfoServiceClient", - "rpcs": { - "GetBusinessInfo": { - "methods": [ - "getBusinessInfo" - ] - }, - "UpdateBusinessInfo": { - "methods": [ - "updateBusinessInfo" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BusinessInfoServiceClient", - "rpcs": { - "GetBusinessInfo": { - "methods": [ - "getBusinessInfo" - ] - }, - "UpdateBusinessInfo": { - "methods": [ - "updateBusinessInfo" - ] - } - } - } - } - }, - "EmailPreferencesService": { - "clients": { - "grpc": { - "libraryClient": "EmailPreferencesServiceClient", - "rpcs": { - "GetEmailPreferences": { - "methods": [ - "getEmailPreferences" - ] - }, - "UpdateEmailPreferences": { - "methods": [ - "updateEmailPreferences" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "EmailPreferencesServiceClient", - "rpcs": { - "GetEmailPreferences": { - "methods": [ - "getEmailPreferences" - ] - }, - "UpdateEmailPreferences": { - "methods": [ - "updateEmailPreferences" - ] - } - } - } - } - }, - "HomepageService": { - "clients": { - "grpc": { - "libraryClient": "HomepageServiceClient", - "rpcs": { - "GetHomepage": { - "methods": [ - "getHomepage" - ] - }, - "UpdateHomepage": { - "methods": [ - "updateHomepage" - ] - }, - "ClaimHomepage": { - "methods": [ - "claimHomepage" - ] - }, - "UnclaimHomepage": { - "methods": [ - "unclaimHomepage" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "HomepageServiceClient", - "rpcs": { - "GetHomepage": { - "methods": [ - "getHomepage" - ] - }, - "UpdateHomepage": { - "methods": [ - "updateHomepage" - ] - }, - "ClaimHomepage": { - "methods": [ - "claimHomepage" - ] - }, - "UnclaimHomepage": { - "methods": [ - "unclaimHomepage" - ] - } - } - } - } - }, - "OnlineReturnPolicyService": { - "clients": { - "grpc": { - "libraryClient": "OnlineReturnPolicyServiceClient", - "rpcs": { - "GetOnlineReturnPolicy": { - "methods": [ - "getOnlineReturnPolicy" - ] - }, - "ListOnlineReturnPolicies": { - "methods": [ - "listOnlineReturnPolicies", - "listOnlineReturnPoliciesStream", - "listOnlineReturnPoliciesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "OnlineReturnPolicyServiceClient", - "rpcs": { - "GetOnlineReturnPolicy": { - "methods": [ - "getOnlineReturnPolicy" - ] - }, - "ListOnlineReturnPolicies": { - "methods": [ - "listOnlineReturnPolicies", - "listOnlineReturnPoliciesStream", - "listOnlineReturnPoliciesAsync" - ] - } - } - } - } - }, - "ProgramsService": { - "clients": { - "grpc": { - "libraryClient": "ProgramsServiceClient", - "rpcs": { - "GetProgram": { - "methods": [ - "getProgram" - ] - }, - "EnableProgram": { - "methods": [ - "enableProgram" - ] - }, - "DisableProgram": { - "methods": [ - "disableProgram" - ] - }, - "ListPrograms": { - "methods": [ - "listPrograms", - "listProgramsStream", - "listProgramsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ProgramsServiceClient", - "rpcs": { - "GetProgram": { - "methods": [ - "getProgram" - ] - }, - "EnableProgram": { - "methods": [ - "enableProgram" - ] - }, - "DisableProgram": { - "methods": [ - "disableProgram" - ] - }, - "ListPrograms": { - "methods": [ - "listPrograms", - "listProgramsStream", - "listProgramsAsync" - ] - } - } - } - } - }, - "RegionsService": { - "clients": { - "grpc": { - "libraryClient": "RegionsServiceClient", - "rpcs": { - "GetRegion": { - "methods": [ - "getRegion" - ] - }, - "CreateRegion": { - "methods": [ - "createRegion" - ] - }, - "UpdateRegion": { - "methods": [ - "updateRegion" - ] - }, - "DeleteRegion": { - "methods": [ - "deleteRegion" - ] - }, - "ListRegions": { - "methods": [ - "listRegions", - "listRegionsStream", - "listRegionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "RegionsServiceClient", - "rpcs": { - "GetRegion": { - "methods": [ - "getRegion" - ] - }, - "CreateRegion": { - "methods": [ - "createRegion" - ] - }, - "UpdateRegion": { - "methods": [ - "updateRegion" - ] - }, - "DeleteRegion": { - "methods": [ - "deleteRegion" - ] - }, - "ListRegions": { - "methods": [ - "listRegions", - "listRegionsStream", - "listRegionsAsync" - ] - } - } - } - } - }, - "ShippingSettingsService": { - "clients": { - "grpc": { - "libraryClient": "ShippingSettingsServiceClient", - "rpcs": { - "GetShippingSettings": { - "methods": [ - "getShippingSettings" - ] - }, - "InsertShippingSettings": { - "methods": [ - "insertShippingSettings" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ShippingSettingsServiceClient", - "rpcs": { - "GetShippingSettings": { - "methods": [ - "getShippingSettings" - ] - }, - "InsertShippingSettings": { - "methods": [ - "insertShippingSettings" - ] - } - } - } - } - }, - "TermsOfServiceAgreementStateService": { - "clients": { - "grpc": { - "libraryClient": "TermsOfServiceAgreementStateServiceClient", - "rpcs": { - "GetTermsOfServiceAgreementState": { - "methods": [ - "getTermsOfServiceAgreementState" - ] - }, - "RetrieveForApplicationTermsOfServiceAgreementState": { - "methods": [ - "retrieveForApplicationTermsOfServiceAgreementState" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "TermsOfServiceAgreementStateServiceClient", - "rpcs": { - "GetTermsOfServiceAgreementState": { - "methods": [ - "getTermsOfServiceAgreementState" - ] - }, - "RetrieveForApplicationTermsOfServiceAgreementState": { - "methods": [ - "retrieveForApplicationTermsOfServiceAgreementState" - ] - } - } - } - } - }, - "TermsOfServiceService": { - "clients": { - "grpc": { - "libraryClient": "TermsOfServiceServiceClient", - "rpcs": { - "GetTermsOfService": { - "methods": [ - "getTermsOfService" - ] - }, - "RetrieveLatestTermsOfService": { - "methods": [ - "retrieveLatestTermsOfService" - ] - }, - "AcceptTermsOfService": { - "methods": [ - "acceptTermsOfService" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "TermsOfServiceServiceClient", - "rpcs": { - "GetTermsOfService": { - "methods": [ - "getTermsOfService" - ] - }, - "RetrieveLatestTermsOfService": { - "methods": [ - "retrieveLatestTermsOfService" - ] - }, - "AcceptTermsOfService": { - "methods": [ - "acceptTermsOfService" - ] - } - } - } - } - }, - "UserService": { - "clients": { - "grpc": { - "libraryClient": "UserServiceClient", - "rpcs": { - "GetUser": { - "methods": [ - "getUser" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "ListUsers": { - "methods": [ - "listUsers", - "listUsersStream", - "listUsersAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "UserServiceClient", - "rpcs": { - "GetUser": { - "methods": [ - "getUser" - ] - }, - "CreateUser": { - "methods": [ - "createUser" - ] - }, - "DeleteUser": { - "methods": [ - "deleteUser" - ] - }, - "UpdateUser": { - "methods": [ - "updateUser" - ] - }, - "ListUsers": { - "methods": [ - "listUsers", - "listUsersStream", - "listUsersAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client.ts deleted file mode 100644 index ba5d2dceaac..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client.ts +++ /dev/null @@ -1,1136 +0,0 @@ -// 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/homepage_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './homepage_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to support an API for a store's homepage. - * @class - * @memberof v1beta - */ -export class HomepageServiceClient { - 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}; - homepageServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of HomepageServiceClient. - * - * @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 HomepageServiceClient({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 HomepageServiceClient; - 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.HomepageService', 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.homepageServiceStub) { - return this.homepageServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.HomepageService. - this.homepageServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.HomepageService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.HomepageService, - 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 homepageServiceStubMethods = - ['getHomepage', 'updateHomepage', 'claimHomepage', 'unclaimHomepage']; - for (const methodName of homepageServiceStubMethods) { - const callPromise = this.homepageServiceStub.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.homepageServiceStub; - } - - /** - * 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 a store's homepage. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the homepage to retrieve. - * Format: `accounts/{account}/homepage` - * @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.Homepage|Homepage}. - * 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/homepage_service.get_homepage.js - * region_tag:merchantapi_v1beta_generated_HomepageService_GetHomepage_async - */ - getHomepage( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|undefined, {}|undefined - ]>; - getHomepage( - request: protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|null|undefined, - {}|null|undefined>): void; - getHomepage( - request: protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|null|undefined, - {}|null|undefined>): void; - getHomepage( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IGetHomepageRequest|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.getHomepage(request, options, callback); - } -/** - * Updates a store's homepage. Executing this method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.shopping.merchant.accounts.v1beta.Homepage} request.homepage - * Required. The new version of the homepage. - * @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.Homepage|Homepage}. - * 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/homepage_service.update_homepage.js - * region_tag:merchantapi_v1beta_generated_HomepageService_UpdateHomepage_async - */ - updateHomepage( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|undefined, {}|undefined - ]>; - updateHomepage( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|null|undefined, - {}|null|undefined>): void; - updateHomepage( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|null|undefined, - {}|null|undefined>): void; - updateHomepage( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUpdateHomepageRequest|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({ - 'homepage.name': request.homepage!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateHomepage(request, options, callback); - } -/** - * Claims a store's homepage. Executing this method requires admin access. - * - * If the homepage is already claimed, this will recheck the - * verification (unless the merchant is exempted from claiming, which also - * exempts from verification) and return a successful response. If ownership - * can no longer be verified, it will return an error, but it won't clear the - * claim. In case of failure, a canonical error message will be returned: - * * PERMISSION_DENIED: user doesn't have the necessary permissions on this - * MC account; - * * FAILED_PRECONDITION: - * - The account is not a Merchant Center account; - * - MC account doesn't have a homepage; - * - claiming failed (in this case the error message will contain more - * details). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the homepage to claim. - * Format: `accounts/{account}/homepage` - * @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.Homepage|Homepage}. - * 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/homepage_service.claim_homepage.js - * region_tag:merchantapi_v1beta_generated_HomepageService_ClaimHomepage_async - */ - claimHomepage( - request?: protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|undefined, {}|undefined - ]>; - claimHomepage( - request: protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|null|undefined, - {}|null|undefined>): void; - claimHomepage( - request: protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|null|undefined, - {}|null|undefined>): void; - claimHomepage( - request?: protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IClaimHomepageRequest|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.claimHomepage(request, options, callback); - } -/** - * Unclaims a store's homepage. Executing this method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the homepage to unclaim. - * Format: `accounts/{account}/homepage` - * @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.Homepage|Homepage}. - * 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/homepage_service.unclaim_homepage.js - * region_tag:merchantapi_v1beta_generated_HomepageService_UnclaimHomepage_async - */ - unclaimHomepage( - request?: protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|undefined, {}|undefined - ]>; - unclaimHomepage( - request: protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|null|undefined, - {}|null|undefined>): void; - unclaimHomepage( - request: protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|null|undefined, - {}|null|undefined>): void; - unclaimHomepage( - request?: protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IHomepage, - protos.google.shopping.merchant.accounts.v1beta.IUnclaimHomepageRequest|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.unclaimHomepage(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.homepageServiceStub && !this._terminated) { - return this.homepageServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client_config.json deleted file mode 100644 index acf219e28d2..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_client_config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.HomepageService": { - "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": { - "GetHomepage": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateHomepage": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ClaimHomepage": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UnclaimHomepage": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/homepage_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/index.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/index.ts deleted file mode 100644 index af8a76c6320..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -// 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. ** - -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'; -export {HomepageServiceClient} from './homepage_service_client'; -export {OnlineReturnPolicyServiceClient} from './online_return_policy_service_client'; -export {ProgramsServiceClient} from './programs_service_client'; -export {RegionsServiceClient} from './regions_service_client'; -export {ShippingSettingsServiceClient} from './shipping_settings_service_client'; -export {TermsOfServiceAgreementStateServiceClient} from './terms_of_service_agreement_state_service_client'; -export {TermsOfServiceServiceClient} from './terms_of_service_service_client'; -export {UserServiceClient} from './user_service_client'; diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client.ts deleted file mode 100644 index db30c65876c..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client.ts +++ /dev/null @@ -1,1128 +0,0 @@ -// 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, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1beta/online_return_policy_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './online_return_policy_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The service facilitates the management of a merchant's remorse return policy - * configuration, encompassing return policies for both ads and free listings - * ## programs. This API defines the following resource model: - * - * {@link protos.google.shopping.merchant.accounts.v1.OnlineReturnPolicy|OnlineReturnPolicy} - * @class - * @memberof v1beta - */ -export class OnlineReturnPolicyServiceClient { - 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}; - onlineReturnPolicyServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of OnlineReturnPolicyServiceClient. - * - * @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 OnlineReturnPolicyServiceClient({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 OnlineReturnPolicyServiceClient; - 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}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listOnlineReturnPolicies: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'onlineReturnPolicies') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService', 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.onlineReturnPolicyServiceStub) { - return this.onlineReturnPolicyServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService. - this.onlineReturnPolicyServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService, - 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 onlineReturnPolicyServiceStubMethods = - ['getOnlineReturnPolicy', 'listOnlineReturnPolicies']; - for (const methodName of onlineReturnPolicyServiceStubMethods) { - const callPromise = this.onlineReturnPolicyServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.onlineReturnPolicyServiceStub; - } - - /** - * 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 -- - // ------------------- -/** - * Gets an existing return policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the return policy to retrieve. - * Format: `accounts/{account}/onlineReturnPolicies/{return_policy}` - * @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.OnlineReturnPolicy|OnlineReturnPolicy}. - * 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/online_return_policy_service.get_online_return_policy.js - * region_tag:merchantapi_v1beta_generated_OnlineReturnPolicyService_GetOnlineReturnPolicy_async - */ - getOnlineReturnPolicy( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, - protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|undefined, {}|undefined - ]>; - getOnlineReturnPolicy( - request: protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, - protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|null|undefined, - {}|null|undefined>): void; - getOnlineReturnPolicy( - request: protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, - protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|null|undefined, - {}|null|undefined>): void; - getOnlineReturnPolicy( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, - protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, - protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy, - protos.google.shopping.merchant.accounts.v1beta.IGetOnlineReturnPolicyRequest|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.getOnlineReturnPolicy(request, options, callback); - } - - /** - * Lists all existing return policies. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The merchant account for which to list return policies. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of `OnlineReturnPolicy` resources to return. - * The service returns fewer than this value if the number of return policies - * for the given merchant is less that than the `pageSize`. The default value - * is 10. The maximum value is 100; If a value higher than the maximum is - * specified, then the `pageSize` will default to the maximum - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListOnlineReturnPolicies` - * call. Provide the page token to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListOnlineReturnPolicies` must match the call that provided the page - * token. The token returned as - * {@link protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token|nextPageToken} - * in the response to the previous request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy|OnlineReturnPolicy}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listOnlineReturnPoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listOnlineReturnPolicies( - request?: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[], - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse - ]>; - listOnlineReturnPolicies( - request: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy>): void; - listOnlineReturnPolicies( - request: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy>): void; - listOnlineReturnPolicies( - request?: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy>, - callback?: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[], - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listOnlineReturnPolicies(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The merchant account for which to list return policies. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of `OnlineReturnPolicy` resources to return. - * The service returns fewer than this value if the number of return policies - * for the given merchant is less that than the `pageSize`. The default value - * is 10. The maximum value is 100; If a value higher than the maximum is - * specified, then the `pageSize` will default to the maximum - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListOnlineReturnPolicies` - * call. Provide the page token to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListOnlineReturnPolicies` must match the call that provided the page - * token. The token returned as - * {@link protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token|nextPageToken} - * in the response to the previous request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy|OnlineReturnPolicy} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listOnlineReturnPoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listOnlineReturnPoliciesStream( - request?: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listOnlineReturnPolicies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listOnlineReturnPolicies.createStream( - this.innerApiCalls.listOnlineReturnPolicies as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listOnlineReturnPolicies`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The merchant account for which to list return policies. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of `OnlineReturnPolicy` resources to return. - * The service returns fewer than this value if the number of return policies - * for the given merchant is less that than the `pageSize`. The default value - * is 10. The maximum value is 100; If a value higher than the maximum is - * specified, then the `pageSize` will default to the maximum - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListOnlineReturnPolicies` - * call. Provide the page token to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListOnlineReturnPolicies` must match the call that provided the page - * token. The token returned as - * {@link protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesResponse.next_page_token|nextPageToken} - * in the response to the previous request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy|OnlineReturnPolicy}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/online_return_policy_service.list_online_return_policies.js - * region_tag:merchantapi_v1beta_generated_OnlineReturnPolicyService_ListOnlineReturnPolicies_async - */ - listOnlineReturnPoliciesAsync( - request?: protos.google.shopping.merchant.accounts.v1beta.IListOnlineReturnPoliciesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listOnlineReturnPolicies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listOnlineReturnPolicies.asyncIterate( - this.innerApiCalls['listOnlineReturnPolicies'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- 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.onlineReturnPolicyServiceStub && !this._terminated) { - return this.onlineReturnPolicyServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client_config.json deleted file mode 100644 index 99ff0cb844f..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_client_config.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.OnlineReturnPolicyService": { - "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": { - "GetOnlineReturnPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListOnlineReturnPolicies": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/online_return_policy_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client.ts deleted file mode 100644 index 2c01f3f53c4..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client.ts +++ /dev/null @@ -1,1254 +0,0 @@ -// 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, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1beta/programs_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './programs_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service for program management. - * - * Programs provide a mechanism for adding functionality to merchant accounts. A - * typical example of this is the [Free product - * listings](https://support.google.com/merchants/topic/9240261?ref_topic=7257954,7259405,&sjid=796648681813264022-EU) - * program, which enables products from a merchant's store to be shown across - * Google for free. - * - * This service exposes methods to retrieve a merchant's - * participation in all available programs, in addition to methods for - * explicitly enabling or disabling participation in each program. - * @class - * @memberof v1beta - */ -export class ProgramsServiceClient { - 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}; - programsServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ProgramsServiceClient. - * - * @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 ProgramsServiceClient({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 ProgramsServiceClient; - 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}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listPrograms: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'programs') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.shopping.merchant.accounts.v1beta.ProgramsService', 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.programsServiceStub) { - return this.programsServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.ProgramsService. - this.programsServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.ProgramsService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.ProgramsService, - 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 programsServiceStubMethods = - ['getProgram', 'listPrograms', 'enableProgram', 'disableProgram']; - for (const methodName of programsServiceStubMethods) { - const callPromise = this.programsServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.programsServiceStub; - } - - /** - * 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 specified program for the account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the program to retrieve. - * Format: `accounts/{account}/programs/{program}` - * @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.Program|Program}. - * 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/programs_service.get_program.js - * region_tag:merchantapi_v1beta_generated_ProgramsService_GetProgram_async - */ - getProgram( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|undefined, {}|undefined - ]>; - getProgram( - request: protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|null|undefined, - {}|null|undefined>): void; - getProgram( - request: protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|null|undefined, - {}|null|undefined>): void; - getProgram( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IGetProgramRequest|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.getProgram(request, options, callback); - } -/** - * Enable participation in the specified program for the account. Executing - * this method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the program for which to enable participation for the - * given account. Format: `accounts/{account}/programs/{program}` - * @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.Program|Program}. - * 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/programs_service.enable_program.js - * region_tag:merchantapi_v1beta_generated_ProgramsService_EnableProgram_async - */ - enableProgram( - request?: protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|undefined, {}|undefined - ]>; - enableProgram( - request: protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|null|undefined, - {}|null|undefined>): void; - enableProgram( - request: protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|null|undefined, - {}|null|undefined>): void; - enableProgram( - request?: protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IEnableProgramRequest|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.enableProgram(request, options, callback); - } -/** - * Disable participation in the specified program for the account. Executing - * this method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the program for which to disable participation for - * the given account. Format: `accounts/{account}/programs/{program}` - * @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.Program|Program}. - * 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/programs_service.disable_program.js - * region_tag:merchantapi_v1beta_generated_ProgramsService_DisableProgram_async - */ - disableProgram( - request?: protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|undefined, {}|undefined - ]>; - disableProgram( - request: protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|null|undefined, - {}|null|undefined>): void; - disableProgram( - request: protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|null|undefined, - {}|null|undefined>): void; - disableProgram( - request?: protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IProgram, - protos.google.shopping.merchant.accounts.v1beta.IDisableProgramRequest|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.disableProgram(request, options, callback); - } - - /** - * Retrieves all programs for the account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the account for which to retrieve all programs. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of programs to return in a single response. If - * unspecified (or 0), a default size of 1000 is used. The maximum value is - * 1000; values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A continuation token, received from a previous `ListPrograms` - * call. Provide this to retrieve the next page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.Program|Program}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listProgramsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listPrograms( - request?: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IProgram[], - protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse - ]>; - listPrograms( - request: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IProgram>): void; - listPrograms( - request: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IProgram>): void; - listPrograms( - request?: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IProgram>, - callback?: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IProgram>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IProgram[], - protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListProgramsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listPrograms(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the account for which to retrieve all programs. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of programs to return in a single response. If - * unspecified (or 0), a default size of 1000 is used. The maximum value is - * 1000; values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A continuation token, received from a previous `ListPrograms` - * call. Provide this to retrieve the next page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Program|Program} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listProgramsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listProgramsStream( - request?: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listPrograms']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPrograms.createStream( - this.innerApiCalls.listPrograms as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listPrograms`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the account for which to retrieve all programs. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of programs to return in a single response. If - * unspecified (or 0), a default size of 1000 is used. The maximum value is - * 1000; values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A continuation token, received from a previous `ListPrograms` - * call. Provide this to retrieve the next page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.shopping.merchant.accounts.v1beta.Program|Program}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/programs_service.list_programs.js - * region_tag:merchantapi_v1beta_generated_ProgramsService_ListPrograms_async - */ - listProgramsAsync( - request?: protos.google.shopping.merchant.accounts.v1beta.IListProgramsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listPrograms']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listPrograms.asyncIterate( - this.innerApiCalls['listPrograms'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- 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.programsServiceStub && !this._terminated) { - return this.programsServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client_config.json deleted file mode 100644 index aa73367335c..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_client_config.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.ProgramsService": { - "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": { - "GetProgram": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListPrograms": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "EnableProgram": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DisableProgram": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/programs_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client.ts deleted file mode 100644 index 244c2b72795..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client.ts +++ /dev/null @@ -1,1340 +0,0 @@ -// 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, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1beta/regions_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './regions_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Manages regions configuration. - * - * This API defines the following resource model: - * - * - {@link protos.google.shopping.merchant.accounts.v1main.Region|Region} - * @class - * @memberof v1beta - */ -export class RegionsServiceClient { - 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}; - regionsServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of RegionsServiceClient. - * - * @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 RegionsServiceClient({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 RegionsServiceClient; - 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}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listRegions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'regions') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.shopping.merchant.accounts.v1beta.RegionsService', 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.regionsServiceStub) { - return this.regionsServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.RegionsService. - this.regionsServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.RegionsService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.RegionsService, - 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 regionsServiceStubMethods = - ['getRegion', 'createRegion', 'updateRegion', 'deleteRegion', 'listRegions']; - for (const methodName of regionsServiceStubMethods) { - const callPromise = this.regionsServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.regionsServiceStub; - } - - /** - * 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 a region defined in your Merchant Center account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the region to retrieve. - * Format: `accounts/{account}/regions/{region}` - * @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.Region|Region}. - * 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/regions_service.get_region.js - * region_tag:merchantapi_v1beta_generated_RegionsService_GetRegion_async - */ - getRegion( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|undefined, {}|undefined - ]>; - getRegion( - request: protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|null|undefined, - {}|null|undefined>): void; - getRegion( - request: protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|null|undefined, - {}|null|undefined>): void; - getRegion( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IGetRegionRequest|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.getRegion(request, options, callback); - } -/** - * Creates a region definition in your Merchant Center account. Executing this - * method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account to create a region for. - * Format: `accounts/{account}` - * @param {string} request.regionId - * Required. The identifier for the region, unique over all regions of the - * same account. - * @param {google.shopping.merchant.accounts.v1beta.Region} request.region - * Required. The region to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Region|Region}. - * 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/regions_service.create_region.js - * region_tag:merchantapi_v1beta_generated_RegionsService_CreateRegion_async - */ - createRegion( - request?: protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|undefined, {}|undefined - ]>; - createRegion( - request: protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|null|undefined, - {}|null|undefined>): void; - createRegion( - request: protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|null|undefined, - {}|null|undefined>): void; - createRegion( - request?: protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.ICreateRegionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createRegion(request, options, callback); - } -/** - * Updates a region definition in your Merchant Center account. Executing this - * method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.shopping.merchant.accounts.v1beta.Region} request.region - * Required. The updated region. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The comma-separated field mask indicating the fields to update. - * Example: - * `"displayName,postalCodeArea.regionCode"`. - * @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.Region|Region}. - * 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/regions_service.update_region.js - * region_tag:merchantapi_v1beta_generated_RegionsService_UpdateRegion_async - */ - updateRegion( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|undefined, {}|undefined - ]>; - updateRegion( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|null|undefined, - {}|null|undefined>): void; - updateRegion( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|null|undefined, - {}|null|undefined>): void; - updateRegion( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IRegion, - protos.google.shopping.merchant.accounts.v1beta.IUpdateRegionRequest|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({ - 'region.name': request.region!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateRegion(request, options, callback); - } -/** - * Deletes a region definition from your Merchant Center account. Executing - * this method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the region to delete. - * Format: `accounts/{account}/regions/{region}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/regions_service.delete_region.js - * region_tag:merchantapi_v1beta_generated_RegionsService_DeleteRegion_async - */ - deleteRegion( - request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|undefined, {}|undefined - ]>; - deleteRegion( - request: protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|null|undefined, - {}|null|undefined>): void; - deleteRegion( - request: protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|null|undefined, - {}|null|undefined>): void; - deleteRegion( - request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteRegionRequest|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.deleteRegion(request, options, callback); - } - - /** - * Lists the regions in your Merchant Center account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account to list regions for. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of regions to return. The service may return - * fewer than this value. - * If unspecified, at most 50 regions will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRegions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListRegions` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.Region|Region}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listRegionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listRegions( - request?: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IRegion[], - protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse - ]>; - listRegions( - request: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IRegion>): void; - listRegions( - request: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IRegion>): void; - listRegions( - request?: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IRegion>, - callback?: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IRegion>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IRegion[], - protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListRegionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listRegions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account to list regions for. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of regions to return. The service may return - * fewer than this value. - * If unspecified, at most 50 regions will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRegions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListRegions` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.Region|Region} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listRegionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listRegionsStream( - request?: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listRegions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listRegions.createStream( - this.innerApiCalls.listRegions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listRegions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account to list regions for. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of regions to return. The service may return - * fewer than this value. - * If unspecified, at most 50 regions will be returned. - * The maximum value is 1000; values above 1000 will be coerced to 1000. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListRegions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListRegions` must - * match the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.shopping.merchant.accounts.v1beta.Region|Region}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/regions_service.list_regions.js - * region_tag:merchantapi_v1beta_generated_RegionsService_ListRegions_async - */ - listRegionsAsync( - request?: protos.google.shopping.merchant.accounts.v1beta.IListRegionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listRegions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listRegions.asyncIterate( - this.innerApiCalls['listRegions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- 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.regionsServiceStub && !this._terminated) { - return this.regionsServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client_config.json deleted file mode 100644 index 05c1621e970..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_client_config.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.RegionsService": { - "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": { - "GetRegion": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateRegion": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateRegion": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteRegion": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListRegions": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/regions_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client.ts deleted file mode 100644 index 1a0734e0f7e..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client.ts +++ /dev/null @@ -1,984 +0,0 @@ -// 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/shipping_settings_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './shipping_settings_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to get method call shipping setting information per Merchant API - * method. - * @class - * @memberof v1beta - */ -export class ShippingSettingsServiceClient { - 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}; - shippingSettingsServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ShippingSettingsServiceClient. - * - * @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 ShippingSettingsServiceClient({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 ShippingSettingsServiceClient; - 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.ShippingSettingsService', 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.shippingSettingsServiceStub) { - return this.shippingSettingsServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.ShippingSettingsService. - this.shippingSettingsServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.ShippingSettingsService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.ShippingSettingsService, - 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 shippingSettingsServiceStubMethods = - ['getShippingSettings', 'insertShippingSettings']; - for (const methodName of shippingSettingsServiceStubMethods) { - const callPromise = this.shippingSettingsServiceStub.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.shippingSettingsServiceStub; - } - - /** - * 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 -- - // ------------------- -/** - * Retrieve shipping setting information. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the shipping setting to retrieve. - * Format: `accounts/{account}/shippingsetting` - * @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.ShippingSettings|ShippingSettings}. - * 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/shipping_settings_service.get_shipping_settings.js - * region_tag:merchantapi_v1beta_generated_ShippingSettingsService_GetShippingSettings_async - */ - getShippingSettings( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|undefined, {}|undefined - ]>; - getShippingSettings( - request: protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|null|undefined, - {}|null|undefined>): void; - getShippingSettings( - request: protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|null|undefined, - {}|null|undefined>): void; - getShippingSettings( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IGetShippingSettingsRequest|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.getShippingSettings(request, options, callback); - } -/** - * Replace the shipping setting of a merchant with the request shipping - * setting. Executing this method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account where this product will be inserted. - * Format: accounts/{account} - * @param {google.shopping.merchant.accounts.v1beta.ShippingSettings} request.shippingSetting - * Required. The new version of the account. - * @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.ShippingSettings|ShippingSettings}. - * 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/shipping_settings_service.insert_shipping_settings.js - * region_tag:merchantapi_v1beta_generated_ShippingSettingsService_InsertShippingSettings_async - */ - insertShippingSettings( - request?: protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|undefined, {}|undefined - ]>; - insertShippingSettings( - request: protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|null|undefined, - {}|null|undefined>): void; - insertShippingSettings( - request: protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|null|undefined, - {}|null|undefined>): void; - insertShippingSettings( - request?: protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IShippingSettings, - protos.google.shopping.merchant.accounts.v1beta.IInsertShippingSettingsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.insertShippingSettings(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.shippingSettingsServiceStub && !this._terminated) { - return this.shippingSettingsServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client_config.json deleted file mode 100644 index 1a72ee658f3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_client_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.ShippingSettingsService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "GetShippingSettings": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "InsertShippingSettings": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/shipping_settings_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client.ts deleted file mode 100644 index a9cccaf8ab0..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client.ts +++ /dev/null @@ -1,981 +0,0 @@ -// 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/terms_of_service_agreement_state_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './terms_of_service_agreement_state_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to support `TermsOfServiceAgreementState` API. - * @class - * @memberof v1beta - */ -export class TermsOfServiceAgreementStateServiceClient { - 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}; - termsOfServiceAgreementStateServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of TermsOfServiceAgreementStateServiceClient. - * - * @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 TermsOfServiceAgreementStateServiceClient({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 TermsOfServiceAgreementStateServiceClient; - 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.TermsOfServiceAgreementStateService', 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.termsOfServiceAgreementStateServiceStub) { - return this.termsOfServiceAgreementStateServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService. - this.termsOfServiceAgreementStateServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService, - 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 termsOfServiceAgreementStateServiceStubMethods = - ['getTermsOfServiceAgreementState', 'retrieveForApplicationTermsOfServiceAgreementState']; - for (const methodName of termsOfServiceAgreementStateServiceStubMethods) { - const callPromise = this.termsOfServiceAgreementStateServiceStub.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.termsOfServiceAgreementStateServiceStub; - } - - /** - * 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 -- - // ------------------- -/** - * Returns the state of a terms of service agreement. - * - * @param {Object} request - * The request object that will be sent. - * @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. - * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState|TermsOfServiceAgreementState}. - * 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/terms_of_service_agreement_state_service.get_terms_of_service_agreement_state.js - * region_tag:merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_GetTermsOfServiceAgreementState_async - */ - getTermsOfServiceAgreementState( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|undefined, {}|undefined - ]>; - getTermsOfServiceAgreementState( - request: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|null|undefined, - {}|null|undefined>): void; - getTermsOfServiceAgreementState( - request: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|null|undefined, - {}|null|undefined>): void; - getTermsOfServiceAgreementState( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceAgreementStateRequest|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.getTermsOfServiceAgreementState(request, options, callback); - } -/** - * Retrieves the state of the agreement for the application terms of service. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The account for which to get a TermsOfServiceAgreementState - * Format: `accounts/{account}` - * @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.TermsOfServiceAgreementState|TermsOfServiceAgreementState}. - * 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/terms_of_service_agreement_state_service.retrieve_for_application_terms_of_service_agreement_state.js - * region_tag:merchantapi_v1beta_generated_TermsOfServiceAgreementStateService_RetrieveForApplicationTermsOfServiceAgreementState_async - */ - retrieveForApplicationTermsOfServiceAgreementState( - request?: protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|undefined, {}|undefined - ]>; - retrieveForApplicationTermsOfServiceAgreementState( - request: protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|null|undefined, - {}|null|undefined>): void; - retrieveForApplicationTermsOfServiceAgreementState( - request: protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|null|undefined, - {}|null|undefined>): void; - retrieveForApplicationTermsOfServiceAgreementState( - request?: protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveForApplicationTermsOfServiceAgreementStateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState(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.termsOfServiceAgreementStateServiceStub && !this._terminated) { - return this.termsOfServiceAgreementStateServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client_config.json deleted file mode 100644 index 312be76fc62..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_client_config.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementStateService": { - "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": { - "GetTermsOfServiceAgreementState": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "RetrieveForApplicationTermsOfServiceAgreementState": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_agreement_state_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client.ts deleted file mode 100644 index 387f57285eb..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client.ts +++ /dev/null @@ -1,1056 +0,0 @@ -// 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/terms_of_service_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './terms_of_service_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to support `TermsOfService` API. - * @class - * @memberof v1beta - */ -export class TermsOfServiceServiceClient { - 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}; - termsOfServiceServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of TermsOfServiceServiceClient. - * - * @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 TermsOfServiceServiceClient({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 TermsOfServiceServiceClient; - 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.TermsOfServiceService', 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.termsOfServiceServiceStub) { - return this.termsOfServiceServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.TermsOfServiceService. - this.termsOfServiceServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.TermsOfServiceService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.TermsOfServiceService, - 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 termsOfServiceServiceStubMethods = - ['getTermsOfService', 'retrieveLatestTermsOfService', 'acceptTermsOfService']; - for (const methodName of termsOfServiceServiceStubMethods) { - const callPromise = this.termsOfServiceServiceStub.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.termsOfServiceServiceStub; - } - - /** - * 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 `TermsOfService` associated with the provided version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the terms of service version. - * Format: `termsOfService/{version}` - * @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.TermsOfService|TermsOfService}. - * 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/terms_of_service_service.get_terms_of_service.js - * region_tag:merchantapi_v1beta_generated_TermsOfServiceService_GetTermsOfService_async - */ - getTermsOfService( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|undefined, {}|undefined - ]>; - getTermsOfService( - request: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|null|undefined, - {}|null|undefined>): void; - getTermsOfService( - request: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|null|undefined, - {}|null|undefined>): void; - getTermsOfService( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IGetTermsOfServiceRequest|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.getTermsOfService(request, options, callback); - } -/** - * Retrieves the latest version of the `TermsOfService` for a given `kind` and - * `region_code`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.regionCode - * 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 - * 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. - * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.TermsOfService|TermsOfService}. - * 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/terms_of_service_service.retrieve_latest_terms_of_service.js - * region_tag:merchantapi_v1beta_generated_TermsOfServiceService_RetrieveLatestTermsOfService_async - */ - retrieveLatestTermsOfService( - request?: protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|undefined, {}|undefined - ]>; - retrieveLatestTermsOfService( - request: protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|null|undefined, - {}|null|undefined>): void; - retrieveLatestTermsOfService( - request: protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|null|undefined, - {}|null|undefined>): void; - retrieveLatestTermsOfService( - request?: protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.ITermsOfService, - protos.google.shopping.merchant.accounts.v1beta.IRetrieveLatestTermsOfServiceRequest|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 || {}; - this.initialize(); - return this.innerApiCalls.retrieveLatestTermsOfService(request, options, callback); - } -/** - * Accepts a `TermsOfService`. Executing this method requires admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the terms of service version. - * Format: `termsOfService/{version}` - * @param {string} request.account - * Required. The account for which to accept the ToS. - * @param {string} request.regionCode - * 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 {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/terms_of_service_service.accept_terms_of_service.js - * region_tag:merchantapi_v1beta_generated_TermsOfServiceService_AcceptTermsOfService_async - */ - acceptTermsOfService( - request?: protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|undefined, {}|undefined - ]>; - acceptTermsOfService( - request: protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|null|undefined, - {}|null|undefined>): void; - acceptTermsOfService( - request: protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|null|undefined, - {}|null|undefined>): void; - acceptTermsOfService( - request?: protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IAcceptTermsOfServiceRequest|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.acceptTermsOfService(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.termsOfServiceServiceStub && !this._terminated) { - return this.termsOfServiceServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client_config.json deleted file mode 100644 index 526f7bf05ce..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_client_config.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.TermsOfServiceService": { - "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": { - "GetTermsOfService": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "RetrieveLatestTermsOfService": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "AcceptTermsOfService": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/terms_of_service_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client.ts deleted file mode 100644 index 058b3cd4045..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client.ts +++ /dev/null @@ -1,1341 +0,0 @@ -// 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, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); - -/** - * Client JSON configuration object, loaded from - * `src/v1beta/user_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './user_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service to support user API. - * @class - * @memberof v1beta - */ -export class UserServiceClient { - 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}; - userServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of UserServiceClient. - * - * @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 UserServiceClient({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 UserServiceClient; - 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}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listUsers: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'users') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.shopping.merchant.accounts.v1beta.UserService', 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.userServiceStub) { - return this.userServiceStub; - } - - // Put together the "service stub" for - // google.shopping.merchant.accounts.v1beta.UserService. - this.userServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.shopping.merchant.accounts.v1beta.UserService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.shopping.merchant.accounts.v1beta.UserService, - 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 userServiceStubMethods = - ['getUser', 'createUser', 'deleteUser', 'updateUser', 'listUsers']; - for (const methodName of userServiceStubMethods) { - const callPromise = this.userServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.userServiceStub; - } - - /** - * 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 a Merchant Center account user. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the user to retrieve. - * Format: `accounts/{account}/users/{email}` - * - * It is also possible to retrieve the user corresponding to the caller by - * using `me` rather than an email address as in - * `accounts/{account}/users/me`. - * @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.User|User}. - * 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/user_service.get_user.js - * region_tag:merchantapi_v1beta_generated_UserService_GetUser_async - */ - getUser( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|undefined, {}|undefined - ]>; - getUser( - request: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|null|undefined, - {}|null|undefined>): void; - getUser( - request: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|null|undefined, - {}|null|undefined>): void; - getUser( - request?: protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IGetUserRequest|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.getUser(request, options, callback); - } -/** - * Creates a Merchant Center account user. Executing this method requires - * admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the account for which a user will be - * created. Format: `accounts/{account}` - * @param {string} request.userId - * Required. The email address of the user (for example, - * `john.doe@gmail.com`). - * @param {google.shopping.merchant.accounts.v1beta.User} request.user - * Required. The user to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.shopping.merchant.accounts.v1beta.User|User}. - * 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/user_service.create_user.js - * region_tag:merchantapi_v1beta_generated_UserService_CreateUser_async - */ - createUser( - request?: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|undefined, {}|undefined - ]>; - createUser( - request: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|null|undefined, - {}|null|undefined>): void; - createUser( - request: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|null|undefined, - {}|null|undefined>): void; - createUser( - request?: protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.ICreateUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createUser(request, options, callback); - } -/** - * Deletes a Merchant Center account user. Executing this method requires - * admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the user to delete. - * Format: `accounts/{account}/users/{email}` - * - * It is also possible to delete the user corresponding to the caller by using - * `me` rather than an email address as in `accounts/{account}/users/me`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/user_service.delete_user.js - * region_tag:merchantapi_v1beta_generated_UserService_DeleteUser_async - */ - deleteUser( - request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|undefined, {}|undefined - ]>; - deleteUser( - request: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|null|undefined, - {}|null|undefined>): void; - deleteUser( - request: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|null|undefined, - {}|null|undefined>): void; - deleteUser( - request?: protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.shopping.merchant.accounts.v1beta.IDeleteUserRequest|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.deleteUser(request, options, callback); - } -/** - * Updates a Merchant Center account user. Executing this method requires - * admin access. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.shopping.merchant.accounts.v1beta.User} request.user - * Required. The new version of the user. - * - * Use `me` to refer to your own email address, for example - * `accounts/{account}/users/me`. - * @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.User|User}. - * 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/user_service.update_user.js - * region_tag:merchantapi_v1beta_generated_UserService_UpdateUser_async - */ - updateUser( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|undefined, {}|undefined - ]>; - updateUser( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, - options: CallOptions, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|null|undefined, - {}|null|undefined>): void; - updateUser( - request: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, - callback: Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|null|undefined, - {}|null|undefined>): void; - updateUser( - request?: protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IUser, - protos.google.shopping.merchant.accounts.v1beta.IUpdateUserRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'user.name': request.user!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateUser(request, options, callback); - } - - /** - * Lists all users of a Merchant Center account. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of users. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of users to return. The service may return - * fewer than this value. If unspecified, at most 50 users will be returned. - * The maximum value is 100; values above 100 will be coerced to 100 - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListUsers` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListUsers` must match - * the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.shopping.merchant.accounts.v1beta.User|User}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listUsersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listUsers( - request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - options?: CallOptions): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IUser[], - protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse - ]>; - listUsers( - request: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IUser>): void; - listUsers( - request: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - callback: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IUser>): void; - listUsers( - request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IUser>, - callback?: PaginationCallback< - protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse|null|undefined, - protos.google.shopping.merchant.accounts.v1beta.IUser>): - Promise<[ - protos.google.shopping.merchant.accounts.v1beta.IUser[], - protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest|null, - protos.google.shopping.merchant.accounts.v1beta.IListUsersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listUsers(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of users. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of users to return. The service may return - * fewer than this value. If unspecified, at most 50 users will be returned. - * The maximum value is 100; values above 100 will be coerced to 100 - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListUsers` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListUsers` must match - * the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.shopping.merchant.accounts.v1beta.User|User} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listUsersAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listUsersStream( - request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsers.createStream( - this.innerApiCalls.listUsers as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listUsers`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of users. - * Format: `accounts/{account}` - * @param {number} [request.pageSize] - * Optional. The maximum number of users to return. The service may return - * fewer than this value. If unspecified, at most 50 users will be returned. - * The maximum value is 100; values above 100 will be coerced to 100 - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListUsers` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListUsers` must match - * the call that provided the page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.shopping.merchant.accounts.v1beta.User|User}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1beta/user_service.list_users.js - * region_tag:merchantapi_v1beta_generated_UserService_ListUsers_async - */ - listUsersAsync( - request?: protos.google.shopping.merchant.accounts.v1beta.IListUsersRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listUsers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listUsers.asyncIterate( - this.innerApiCalls['listUsers'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- 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.userServiceStub && !this._terminated) { - return this.userServiceStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client_config.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client_config.json deleted file mode 100644 index fcd414e87d4..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_client_config.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "interfaces": { - "google.shopping.merchant.accounts.v1beta.UserService": { - "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": { - "GetUser": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateUser": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "DeleteUser": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateUser": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListUsers": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_proto_list.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_proto_list.json deleted file mode 100644 index 28ca4b888d3..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/user_service_proto_list.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - "../../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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.js deleted file mode 100644 index d80628c5370..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,41 +0,0 @@ -// 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. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const accounts = require('@google-shopping/accounts'); - -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(); - const emailPreferencesServiceClient = new accounts.EmailPreferencesServiceClient(); - const homepageServiceClient = new accounts.HomepageServiceClient(); - const onlineReturnPolicyServiceClient = new accounts.OnlineReturnPolicyServiceClient(); - const programsServiceClient = new accounts.ProgramsServiceClient(); - const regionsServiceClient = new accounts.RegionsServiceClient(); - const shippingSettingsServiceClient = new accounts.ShippingSettingsServiceClient(); - const termsOfServiceAgreementStateServiceClient = new accounts.TermsOfServiceAgreementStateServiceClient(); - const termsOfServiceServiceClient = new accounts.TermsOfServiceServiceClient(); - const userServiceClient = new accounts.UserServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 5c255fc89fb..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,116 +0,0 @@ -// 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 {AccountIssueServiceClient, AccountsServiceClient, AccountTaxServiceClient, AutofeedSettingsServiceClient, BusinessIdentityServiceClient, BusinessInfoServiceClient, EmailPreferencesServiceClient, HomepageServiceClient, OnlineReturnPolicyServiceClient, ProgramsServiceClient, RegionsServiceClient, ShippingSettingsServiceClient, TermsOfServiceAgreementStateServiceClient, TermsOfServiceServiceClient, UserServiceClient} from '@google-shopping/accounts'; - -// check that the client class type name can be used -function doStuffWithAccountIssueServiceClient(client: AccountIssueServiceClient) { - client.close(); -} -function doStuffWithAccountsServiceClient(client: AccountsServiceClient) { - client.close(); -} -function doStuffWithAccountTaxServiceClient(client: AccountTaxServiceClient) { - client.close(); -} -function doStuffWithAutofeedSettingsServiceClient(client: AutofeedSettingsServiceClient) { - client.close(); -} -function doStuffWithBusinessIdentityServiceClient(client: BusinessIdentityServiceClient) { - client.close(); -} -function doStuffWithBusinessInfoServiceClient(client: BusinessInfoServiceClient) { - client.close(); -} -function doStuffWithEmailPreferencesServiceClient(client: EmailPreferencesServiceClient) { - client.close(); -} -function doStuffWithHomepageServiceClient(client: HomepageServiceClient) { - client.close(); -} -function doStuffWithOnlineReturnPolicyServiceClient(client: OnlineReturnPolicyServiceClient) { - client.close(); -} -function doStuffWithProgramsServiceClient(client: ProgramsServiceClient) { - client.close(); -} -function doStuffWithRegionsServiceClient(client: RegionsServiceClient) { - client.close(); -} -function doStuffWithShippingSettingsServiceClient(client: ShippingSettingsServiceClient) { - client.close(); -} -function doStuffWithTermsOfServiceAgreementStateServiceClient(client: TermsOfServiceAgreementStateServiceClient) { - client.close(); -} -function doStuffWithTermsOfServiceServiceClient(client: TermsOfServiceServiceClient) { - client.close(); -} -function doStuffWithUserServiceClient(client: UserServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const accountIssueServiceClient = new AccountIssueServiceClient(); - doStuffWithAccountIssueServiceClient(accountIssueServiceClient); - // check that the client instance can be created - const accountsServiceClient = new AccountsServiceClient(); - doStuffWithAccountsServiceClient(accountsServiceClient); - // check that the client instance can be created - 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 - const businessInfoServiceClient = new BusinessInfoServiceClient(); - doStuffWithBusinessInfoServiceClient(businessInfoServiceClient); - // check that the client instance can be created - const emailPreferencesServiceClient = new EmailPreferencesServiceClient(); - doStuffWithEmailPreferencesServiceClient(emailPreferencesServiceClient); - // check that the client instance can be created - const homepageServiceClient = new HomepageServiceClient(); - doStuffWithHomepageServiceClient(homepageServiceClient); - // check that the client instance can be created - const onlineReturnPolicyServiceClient = new OnlineReturnPolicyServiceClient(); - doStuffWithOnlineReturnPolicyServiceClient(onlineReturnPolicyServiceClient); - // check that the client instance can be created - const programsServiceClient = new ProgramsServiceClient(); - doStuffWithProgramsServiceClient(programsServiceClient); - // check that the client instance can be created - const regionsServiceClient = new RegionsServiceClient(); - doStuffWithRegionsServiceClient(regionsServiceClient); - // check that the client instance can be created - const shippingSettingsServiceClient = new ShippingSettingsServiceClient(); - doStuffWithShippingSettingsServiceClient(shippingSettingsServiceClient); - // check that the client instance can be created - const termsOfServiceAgreementStateServiceClient = new TermsOfServiceAgreementStateServiceClient(); - doStuffWithTermsOfServiceAgreementStateServiceClient(termsOfServiceAgreementStateServiceClient); - // check that the client instance can be created - const termsOfServiceServiceClient = new TermsOfServiceServiceClient(); - doStuffWithTermsOfServiceServiceClient(termsOfServiceServiceClient); - // check that the client instance can be created - const userServiceClient = new UserServiceClient(); - doStuffWithUserServiceClient(userServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/install.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/install.ts deleted file mode 100644 index fd5bfdc71d5..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// 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 {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_issue_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_issue_service_v1beta.ts deleted file mode 100644 index 57ad6140c53..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_issue_service_v1beta.ts +++ /dev/null @@ -1,1023 +0,0 @@ -// 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 accountissueserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta.AccountIssueServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient(); - 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 = accountissueserviceModule.v1beta.AccountIssueServiceClient.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 = accountissueserviceModule.v1beta.AccountIssueServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({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 accountissueserviceModule.v1beta.AccountIssueServiceClient(); - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({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 accountissueserviceModule.v1beta.AccountIssueServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = accountissueserviceModule.v1beta.AccountIssueServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.accountIssueServiceStub, undefined); - await client.initialize(); - assert(client.accountIssueServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.accountIssueServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.accountIssueServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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('listAccountIssues', () => { - it('invokes listAccountIssues without error', async () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - ]; - client.innerApiCalls.listAccountIssues = stubSimpleCall(expectedResponse); - const [response] = await client.listAccountIssues(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAccountIssues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAccountIssues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAccountIssues without error using callback', async () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - ]; - client.innerApiCalls.listAccountIssues = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAccountIssues( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAccountIssues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAccountIssues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAccountIssues with error', async () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAccountIssues = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccountIssues(request), expectedError); - const actualRequest = (client.innerApiCalls.listAccountIssues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAccountIssues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAccountIssuesStream without error', async () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - ]; - client.descriptors.page.listAccountIssues.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAccountIssuesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.AccountIssue[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.AccountIssue) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAccountIssues.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccountIssues, request)); - assert( - (client.descriptors.page.listAccountIssues.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAccountIssuesStream with error', async () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAccountIssues.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAccountIssuesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.AccountIssue[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.AccountIssue) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAccountIssues.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccountIssues, request)); - assert( - (client.descriptors.page.listAccountIssues.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAccountIssues without error', async () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountIssue()), - ]; - client.descriptors.page.listAccountIssues.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[] = []; - const iterable = client.listAccountIssuesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAccountIssues.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAccountIssues.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAccountIssues with error', async () => { - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountIssuesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAccountIssues.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAccountIssuesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.shopping.merchant.accounts.v1beta.IAccountIssue[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAccountIssues.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAccountIssues.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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 accountissueserviceModule.v1beta.AccountIssueServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_tax_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_tax_service_v1beta.ts deleted file mode 100644 index cdef353986a..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_account_tax_service_v1beta.ts +++ /dev/null @@ -1,1243 +0,0 @@ -// 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 accounttaxserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta.AccountTaxServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient(); - 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 = accounttaxserviceModule.v1beta.AccountTaxServiceClient.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 = accounttaxserviceModule.v1beta.AccountTaxServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({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 accounttaxserviceModule.v1beta.AccountTaxServiceClient(); - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = accounttaxserviceModule.v1beta.AccountTaxServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.accountTaxServiceStub, undefined); - await client.initialize(); - assert(client.accountTaxServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.accountTaxServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.accountTaxServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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('getAccountTax', () => { - it('invokes getAccountTax without error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.AccountTax() - ); - client.innerApiCalls.getAccountTax = stubSimpleCall(expectedResponse); - const [response] = await client.getAccountTax(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAccountTax as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccountTax as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccountTax without error using callback', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.AccountTax() - ); - client.innerApiCalls.getAccountTax = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAccountTax( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccountTax|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAccountTax as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccountTax as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccountTax with error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAccountTax = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAccountTax(request), expectedError); - const actualRequest = (client.innerApiCalls.getAccountTax as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccountTax as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccountTax with closed client', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountTaxRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAccountTax(request), expectedError); - }); - }); - - describe('updateAccountTax', () => { - it('invokes updateAccountTax without error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest() - ); - request.accountTax ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest', ['accountTax', 'name']); - request.accountTax.name = defaultValue1; - const expectedHeaderRequestParams = `account_tax.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.AccountTax() - ); - client.innerApiCalls.updateAccountTax = stubSimpleCall(expectedResponse); - const [response] = await client.updateAccountTax(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAccountTax as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccountTax as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccountTax without error using callback', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest() - ); - request.accountTax ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest', ['accountTax', 'name']); - request.accountTax.name = defaultValue1; - const expectedHeaderRequestParams = `account_tax.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.AccountTax() - ); - client.innerApiCalls.updateAccountTax = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAccountTax( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccountTax|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAccountTax as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccountTax as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccountTax with error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest() - ); - request.accountTax ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest', ['accountTax', 'name']); - request.accountTax.name = defaultValue1; - const expectedHeaderRequestParams = `account_tax.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAccountTax = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAccountTax(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAccountTax as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccountTax as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccountTax with closed client', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest() - ); - request.accountTax ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountTaxRequest', ['accountTax', 'name']); - request.accountTax.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateAccountTax(request), expectedError); - }); - }); - - describe('listAccountTax', () => { - it('invokes listAccountTax without error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - ]; - client.innerApiCalls.listAccountTax = stubSimpleCall(expectedResponse); - const [response] = await client.listAccountTax(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAccountTax as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAccountTax as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAccountTax without error using callback', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - ]; - client.innerApiCalls.listAccountTax = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAccountTax( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccountTax[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAccountTax as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAccountTax as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAccountTax with error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAccountTax = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccountTax(request), expectedError); - const actualRequest = (client.innerApiCalls.listAccountTax as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAccountTax as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAccountTaxStream without error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - ]; - client.descriptors.page.listAccountTax.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAccountTaxStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.AccountTax[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.AccountTax) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAccountTax.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccountTax, request)); - assert( - (client.descriptors.page.listAccountTax.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAccountTaxStream with error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAccountTax.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAccountTaxStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.AccountTax[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.AccountTax) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAccountTax.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccountTax, request)); - assert( - (client.descriptors.page.listAccountTax.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAccountTax without error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.AccountTax()), - ]; - client.descriptors.page.listAccountTax.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.shopping.merchant.accounts.v1beta.IAccountTax[] = []; - const iterable = client.listAccountTaxAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAccountTax.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAccountTax.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAccountTax with error', async () => { - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListAccountTaxRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAccountTax.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAccountTaxAsync(request); - await assert.rejects(async () => { - const responses: protos.google.shopping.merchant.accounts.v1beta.IAccountTax[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAccountTax.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAccountTax.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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 accounttaxserviceModule.v1beta.AccountTaxServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_accounts_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_accounts_service_v1beta.ts deleted file mode 100644 index 6adc8ca6d78..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_accounts_service_v1beta.ts +++ /dev/null @@ -1,1601 +0,0 @@ -// 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 accountsserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta.AccountsServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient(); - 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 = accountsserviceModule.v1beta.AccountsServiceClient.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 = accountsserviceModule.v1beta.AccountsServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({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 accountsserviceModule.v1beta.AccountsServiceClient(); - 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 accountsserviceModule.v1beta.AccountsServiceClient({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 accountsserviceModule.v1beta.AccountsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = accountsserviceModule.v1beta.AccountsServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.accountsServiceStub, undefined); - await client.initialize(); - assert(client.accountsServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.accountsServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.accountsServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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('getAccount', () => { - it('invokes getAccount without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Account() - ); - client.innerApiCalls.getAccount = stubSimpleCall(expectedResponse); - const [response] = await client.getAccount(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccount without error using callback', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Account() - ); - client.innerApiCalls.getAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAccount( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccount with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAccount with closed client', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetAccountRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAccount(request), expectedError); - }); - }); - - describe('createAndConfigureAccount', () => { - it('invokes createAndConfigureAccount without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Account() - ); - client.innerApiCalls.createAndConfigureAccount = stubSimpleCall(expectedResponse); - const [response] = await client.createAndConfigureAccount(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes createAndConfigureAccount without error using callback', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Account() - ); - client.innerApiCalls.createAndConfigureAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAndConfigureAccount( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes createAndConfigureAccount with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.createAndConfigureAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAndConfigureAccount(request), expectedError); - }); - - it('invokes createAndConfigureAccount with closed client', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateAndConfigureAccountRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createAndConfigureAccount(request), expectedError); - }); - }); - - describe('deleteAccount', () => { - it('invokes deleteAccount without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAccount = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAccount(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAccount without error using callback', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAccount( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAccount with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAccount with closed client', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteAccountRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteAccount(request), expectedError); - }); - }); - - describe('updateAccount', () => { - it('invokes updateAccount without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest() - ); - request.account ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Account() - ); - client.innerApiCalls.updateAccount = stubSimpleCall(expectedResponse); - const [response] = await client.updateAccount(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccount without error using callback', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest() - ); - request.account ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Account() - ); - client.innerApiCalls.updateAccount = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAccount( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccount with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest() - ); - request.account ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAccount = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAccount(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAccount as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAccount with closed client', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest() - ); - request.account ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateAccountRequest', ['account', 'name']); - request.account.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateAccount(request), expectedError); - }); - }); - - describe('listAccounts', () => { - it('invokes listAccounts without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - ]; - client.innerApiCalls.listAccounts = stubSimpleCall(expectedResponse); - const [response] = await client.listAccounts(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listAccounts without error using callback', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() - );const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - ]; - client.innerApiCalls.listAccounts = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAccounts( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes listAccounts with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.listAccounts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAccounts(request), expectedError); - }); - - it('invokes listAccountsStream without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - ]; - client.descriptors.page.listAccounts.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAccountsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.Account[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Account) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAccounts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccounts, request)); - }); - - it('invokes listAccountsStream with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() - ); - const expectedError = new Error('expected'); - client.descriptors.page.listAccounts.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAccountsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.Account[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Account) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAccounts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAccounts, request)); - }); - - it('uses async iteration with listAccounts without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() - ); - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - ]; - client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.shopping.merchant.accounts.v1beta.IAccount[] = []; - const iterable = client.listAccountsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAccounts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - - it('uses async iteration with listAccounts with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListAccountsRequest() - ); - const expectedError = new Error('expected'); - client.descriptors.page.listAccounts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAccountsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.shopping.merchant.accounts.v1beta.IAccount[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAccounts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('listSubAccounts', () => { - it('invokes listSubAccounts without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); - request.provider = defaultValue1; - const expectedHeaderRequestParams = `provider=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - ]; - client.innerApiCalls.listSubAccounts = stubSimpleCall(expectedResponse); - const [response] = await client.listSubAccounts(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSubAccounts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSubAccounts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSubAccounts without error using callback', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); - request.provider = defaultValue1; - const expectedHeaderRequestParams = `provider=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - ]; - client.innerApiCalls.listSubAccounts = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSubAccounts( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IAccount[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSubAccounts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSubAccounts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSubAccounts with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); - request.provider = defaultValue1; - const expectedHeaderRequestParams = `provider=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSubAccounts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSubAccounts(request), expectedError); - const actualRequest = (client.innerApiCalls.listSubAccounts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSubAccounts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSubAccountsStream without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); - request.provider = defaultValue1; - const expectedHeaderRequestParams = `provider=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - ]; - client.descriptors.page.listSubAccounts.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSubAccountsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.Account[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Account) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSubAccounts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSubAccounts, request)); - assert( - (client.descriptors.page.listSubAccounts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSubAccountsStream with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); - request.provider = defaultValue1; - const expectedHeaderRequestParams = `provider=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSubAccounts.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSubAccountsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.Account[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Account) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSubAccounts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSubAccounts, request)); - assert( - (client.descriptors.page.listSubAccounts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSubAccounts without error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); - request.provider = defaultValue1; - const expectedHeaderRequestParams = `provider=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Account()), - ]; - client.descriptors.page.listSubAccounts.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.shopping.merchant.accounts.v1beta.IAccount[] = []; - const iterable = client.listSubAccountsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSubAccounts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSubAccounts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSubAccounts with error', async () => { - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListSubAccountsRequest', ['provider']); - request.provider = defaultValue1; - const expectedHeaderRequestParams = `provider=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSubAccounts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSubAccountsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.shopping.merchant.accounts.v1beta.IAccount[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSubAccounts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSubAccounts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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 accountsserviceModule.v1beta.AccountsServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_autofeed_settings_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_autofeed_settings_service_v1beta.ts deleted file mode 100644 index e049d0f6278..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_autofeed_settings_service_v1beta.ts +++ /dev/null @@ -1,951 +0,0 @@ -// 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_identity_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_identity_service_v1beta.ts deleted file mode 100644 index 32b06cd929f..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_identity_service_v1beta.ts +++ /dev/null @@ -1,951 +0,0 @@ -// 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 businessidentityserviceModule 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.BusinessIdentityServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient(); - 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 = businessidentityserviceModule.v1beta.BusinessIdentityServiceClient.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 = businessidentityserviceModule.v1beta.BusinessIdentityServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient(); - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = businessidentityserviceModule.v1beta.BusinessIdentityServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.businessIdentityServiceStub, undefined); - await client.initialize(); - assert(client.businessIdentityServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.businessIdentityServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.businessIdentityServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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('getBusinessIdentity', () => { - it('invokes getBusinessIdentity without error', async () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.BusinessIdentity() - ); - client.innerApiCalls.getBusinessIdentity = stubSimpleCall(expectedResponse); - const [response] = await client.getBusinessIdentity(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBusinessIdentity as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBusinessIdentity as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBusinessIdentity without error using callback', async () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.BusinessIdentity() - ); - client.innerApiCalls.getBusinessIdentity = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBusinessIdentity( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBusinessIdentity as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBusinessIdentity as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBusinessIdentity with error', async () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBusinessIdentity = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBusinessIdentity(request), expectedError); - const actualRequest = (client.innerApiCalls.getBusinessIdentity as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBusinessIdentity as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBusinessIdentity with closed client', async () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessIdentityRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getBusinessIdentity(request), expectedError); - }); - }); - - describe('updateBusinessIdentity', () => { - it('invokes updateBusinessIdentity without error', async () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest() - ); - request.businessIdentity ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest', ['businessIdentity', 'name']); - request.businessIdentity.name = defaultValue1; - const expectedHeaderRequestParams = `business_identity.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.BusinessIdentity() - ); - client.innerApiCalls.updateBusinessIdentity = stubSimpleCall(expectedResponse); - const [response] = await client.updateBusinessIdentity(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBusinessIdentity as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessIdentity as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBusinessIdentity without error using callback', async () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest() - ); - request.businessIdentity ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest', ['businessIdentity', 'name']); - request.businessIdentity.name = defaultValue1; - const expectedHeaderRequestParams = `business_identity.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.BusinessIdentity() - ); - client.innerApiCalls.updateBusinessIdentity = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBusinessIdentity( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IBusinessIdentity|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBusinessIdentity as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessIdentity as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBusinessIdentity with error', async () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest() - ); - request.businessIdentity ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest', ['businessIdentity', 'name']); - request.businessIdentity.name = defaultValue1; - const expectedHeaderRequestParams = `business_identity.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBusinessIdentity = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateBusinessIdentity(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBusinessIdentity as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessIdentity as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBusinessIdentity with closed client', async () => { - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest() - ); - request.businessIdentity ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessIdentityRequest', ['businessIdentity', 'name']); - request.businessIdentity.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateBusinessIdentity(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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 businessidentityserviceModule.v1beta.BusinessIdentityServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_info_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_info_service_v1beta.ts deleted file mode 100644 index a4fe976b079..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_business_info_service_v1beta.ts +++ /dev/null @@ -1,951 +0,0 @@ -// 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 businessinfoserviceModule 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.BusinessInfoServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient(); - 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 = businessinfoserviceModule.v1beta.BusinessInfoServiceClient.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 = businessinfoserviceModule.v1beta.BusinessInfoServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient(); - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = businessinfoserviceModule.v1beta.BusinessInfoServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.businessInfoServiceStub, undefined); - await client.initialize(); - assert(client.businessInfoServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.businessInfoServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.businessInfoServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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('getBusinessInfo', () => { - it('invokes getBusinessInfo without error', async () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.BusinessInfo() - ); - client.innerApiCalls.getBusinessInfo = stubSimpleCall(expectedResponse); - const [response] = await client.getBusinessInfo(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBusinessInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBusinessInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBusinessInfo without error using callback', async () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.BusinessInfo() - ); - client.innerApiCalls.getBusinessInfo = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBusinessInfo( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBusinessInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBusinessInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBusinessInfo with error', async () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBusinessInfo = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBusinessInfo(request), expectedError); - const actualRequest = (client.innerApiCalls.getBusinessInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBusinessInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBusinessInfo with closed client', async () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetBusinessInfoRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getBusinessInfo(request), expectedError); - }); - }); - - describe('updateBusinessInfo', () => { - it('invokes updateBusinessInfo without error', async () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest() - ); - request.businessInfo ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest', ['businessInfo', 'name']); - request.businessInfo.name = defaultValue1; - const expectedHeaderRequestParams = `business_info.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.BusinessInfo() - ); - client.innerApiCalls.updateBusinessInfo = stubSimpleCall(expectedResponse); - const [response] = await client.updateBusinessInfo(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBusinessInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBusinessInfo without error using callback', async () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest() - ); - request.businessInfo ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest', ['businessInfo', 'name']); - request.businessInfo.name = defaultValue1; - const expectedHeaderRequestParams = `business_info.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.BusinessInfo() - ); - client.innerApiCalls.updateBusinessInfo = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBusinessInfo( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IBusinessInfo|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBusinessInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBusinessInfo with error', async () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest() - ); - request.businessInfo ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest', ['businessInfo', 'name']); - request.businessInfo.name = defaultValue1; - const expectedHeaderRequestParams = `business_info.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBusinessInfo = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateBusinessInfo(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBusinessInfo as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBusinessInfo as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBusinessInfo with closed client', async () => { - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest() - ); - request.businessInfo ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateBusinessInfoRequest', ['businessInfo', 'name']); - request.businessInfo.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateBusinessInfo(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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 businessinfoserviceModule.v1beta.BusinessInfoServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_email_preferences_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_email_preferences_service_v1beta.ts deleted file mode 100644 index 2818ed6646c..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_email_preferences_service_v1beta.ts +++ /dev/null @@ -1,951 +0,0 @@ -// 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 emailpreferencesserviceModule 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.EmailPreferencesServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient(); - 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 = emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient.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 = emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient(); - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.emailPreferencesServiceStub, undefined); - await client.initialize(); - assert(client.emailPreferencesServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.emailPreferencesServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.emailPreferencesServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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('getEmailPreferences', () => { - it('invokes getEmailPreferences without error', async () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.EmailPreferences() - ); - client.innerApiCalls.getEmailPreferences = stubSimpleCall(expectedResponse); - const [response] = await client.getEmailPreferences(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEmailPreferences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEmailPreferences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEmailPreferences without error using callback', async () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.EmailPreferences() - ); - client.innerApiCalls.getEmailPreferences = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEmailPreferences( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEmailPreferences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEmailPreferences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEmailPreferences with error', async () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEmailPreferences = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEmailPreferences(request), expectedError); - const actualRequest = (client.innerApiCalls.getEmailPreferences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEmailPreferences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEmailPreferences with closed client', async () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetEmailPreferencesRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getEmailPreferences(request), expectedError); - }); - }); - - describe('updateEmailPreferences', () => { - it('invokes updateEmailPreferences without error', async () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest() - ); - request.emailPreferences ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest', ['emailPreferences', 'name']); - request.emailPreferences.name = defaultValue1; - const expectedHeaderRequestParams = `email_preferences.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.EmailPreferences() - ); - client.innerApiCalls.updateEmailPreferences = stubSimpleCall(expectedResponse); - const [response] = await client.updateEmailPreferences(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateEmailPreferences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEmailPreferences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEmailPreferences without error using callback', async () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest() - ); - request.emailPreferences ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest', ['emailPreferences', 'name']); - request.emailPreferences.name = defaultValue1; - const expectedHeaderRequestParams = `email_preferences.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.EmailPreferences() - ); - client.innerApiCalls.updateEmailPreferences = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateEmailPreferences( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IEmailPreferences|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateEmailPreferences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEmailPreferences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEmailPreferences with error', async () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest() - ); - request.emailPreferences ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest', ['emailPreferences', 'name']); - request.emailPreferences.name = defaultValue1; - const expectedHeaderRequestParams = `email_preferences.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEmailPreferences = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEmailPreferences(request), expectedError); - const actualRequest = (client.innerApiCalls.updateEmailPreferences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEmailPreferences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEmailPreferences with closed client', async () => { - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest() - ); - request.emailPreferences ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateEmailPreferencesRequest', ['emailPreferences', 'name']); - request.emailPreferences.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateEmailPreferences(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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 emailpreferencesserviceModule.v1beta.EmailPreferencesServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_homepage_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_homepage_service_v1beta.ts deleted file mode 100644 index 683a2dd144f..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_homepage_service_v1beta.ts +++ /dev/null @@ -1,1167 +0,0 @@ -// 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 homepageserviceModule 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.HomepageServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient(); - 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 = homepageserviceModule.v1beta.HomepageServiceClient.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 = homepageserviceModule.v1beta.HomepageServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({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 homepageserviceModule.v1beta.HomepageServiceClient(); - 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 homepageserviceModule.v1beta.HomepageServiceClient({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 homepageserviceModule.v1beta.HomepageServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = homepageserviceModule.v1beta.HomepageServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.homepageServiceStub, undefined); - await client.initialize(); - assert(client.homepageServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.homepageServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.homepageServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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('getHomepage', () => { - it('invokes getHomepage without error', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Homepage() - ); - client.innerApiCalls.getHomepage = stubSimpleCall(expectedResponse); - const [response] = await client.getHomepage(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getHomepage without error using callback', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Homepage() - ); - client.innerApiCalls.getHomepage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getHomepage( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IHomepage|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getHomepage with error', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getHomepage = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getHomepage(request), expectedError); - const actualRequest = (client.innerApiCalls.getHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getHomepage with closed client', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getHomepage(request), expectedError); - }); - }); - - describe('updateHomepage', () => { - it('invokes updateHomepage without error', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest() - ); - request.homepage ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest', ['homepage', 'name']); - request.homepage.name = defaultValue1; - const expectedHeaderRequestParams = `homepage.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Homepage() - ); - client.innerApiCalls.updateHomepage = stubSimpleCall(expectedResponse); - const [response] = await client.updateHomepage(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateHomepage without error using callback', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest() - ); - request.homepage ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest', ['homepage', 'name']); - request.homepage.name = defaultValue1; - const expectedHeaderRequestParams = `homepage.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Homepage() - ); - client.innerApiCalls.updateHomepage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateHomepage( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IHomepage|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateHomepage with error', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest() - ); - request.homepage ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest', ['homepage', 'name']); - request.homepage.name = defaultValue1; - const expectedHeaderRequestParams = `homepage.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateHomepage = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateHomepage(request), expectedError); - const actualRequest = (client.innerApiCalls.updateHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateHomepage with closed client', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest() - ); - request.homepage ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateHomepageRequest', ['homepage', 'name']); - request.homepage.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateHomepage(request), expectedError); - }); - }); - - describe('claimHomepage', () => { - it('invokes claimHomepage without error', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Homepage() - ); - client.innerApiCalls.claimHomepage = stubSimpleCall(expectedResponse); - const [response] = await client.claimHomepage(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.claimHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.claimHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes claimHomepage without error using callback', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Homepage() - ); - client.innerApiCalls.claimHomepage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.claimHomepage( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IHomepage|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.claimHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.claimHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes claimHomepage with error', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.claimHomepage = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.claimHomepage(request), expectedError); - const actualRequest = (client.innerApiCalls.claimHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.claimHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes claimHomepage with closed client', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ClaimHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.claimHomepage(request), expectedError); - }); - }); - - describe('unclaimHomepage', () => { - it('invokes unclaimHomepage without error', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Homepage() - ); - client.innerApiCalls.unclaimHomepage = stubSimpleCall(expectedResponse); - const [response] = await client.unclaimHomepage(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.unclaimHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.unclaimHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes unclaimHomepage without error using callback', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Homepage() - ); - client.innerApiCalls.unclaimHomepage = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.unclaimHomepage( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IHomepage|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.unclaimHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.unclaimHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes unclaimHomepage with error', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.unclaimHomepage = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.unclaimHomepage(request), expectedError); - const actualRequest = (client.innerApiCalls.unclaimHomepage as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.unclaimHomepage as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes unclaimHomepage with closed client', async () => { - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UnclaimHomepageRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.unclaimHomepage(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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 homepageserviceModule.v1beta.HomepageServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_online_return_policy_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_online_return_policy_service_v1beta.ts deleted file mode 100644 index bf40038d9a7..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_online_return_policy_service_v1beta.ts +++ /dev/null @@ -1,1131 +0,0 @@ -// 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 onlinereturnpolicyserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta.OnlineReturnPolicyServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient(); - 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 = onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient.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 = onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient(); - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.onlineReturnPolicyServiceStub, undefined); - await client.initialize(); - assert(client.onlineReturnPolicyServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.onlineReturnPolicyServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.onlineReturnPolicyServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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('getOnlineReturnPolicy', () => { - it('invokes getOnlineReturnPolicy without error', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy() - ); - client.innerApiCalls.getOnlineReturnPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getOnlineReturnPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOnlineReturnPolicy without error using callback', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy() - ); - client.innerApiCalls.getOnlineReturnPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getOnlineReturnPolicy( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOnlineReturnPolicy with error', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getOnlineReturnPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getOnlineReturnPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getOnlineReturnPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getOnlineReturnPolicy with closed client', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetOnlineReturnPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getOnlineReturnPolicy(request), expectedError); - }); - }); - - describe('listOnlineReturnPolicies', () => { - it('invokes listOnlineReturnPolicies without error', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - ]; - client.innerApiCalls.listOnlineReturnPolicies = stubSimpleCall(expectedResponse); - const [response] = await client.listOnlineReturnPolicies(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOnlineReturnPolicies without error using callback', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - ]; - client.innerApiCalls.listOnlineReturnPolicies = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listOnlineReturnPolicies( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOnlineReturnPolicies with error', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listOnlineReturnPolicies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOnlineReturnPolicies(request), expectedError); - const actualRequest = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOnlineReturnPolicies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listOnlineReturnPoliciesStream without error', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - ]; - client.descriptors.page.listOnlineReturnPolicies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listOnlineReturnPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listOnlineReturnPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listOnlineReturnPolicies, request)); - assert( - (client.descriptors.page.listOnlineReturnPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listOnlineReturnPoliciesStream with error', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listOnlineReturnPolicies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listOnlineReturnPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listOnlineReturnPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listOnlineReturnPolicies, request)); - assert( - (client.descriptors.page.listOnlineReturnPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listOnlineReturnPolicies without error', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy()), - ]; - client.descriptors.page.listOnlineReturnPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[] = []; - const iterable = client.listOnlineReturnPoliciesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listOnlineReturnPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listOnlineReturnPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listOnlineReturnPolicies with error', async () => { - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListOnlineReturnPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listOnlineReturnPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listOnlineReturnPoliciesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.shopping.merchant.accounts.v1beta.IOnlineReturnPolicy[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listOnlineReturnPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listOnlineReturnPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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 onlinereturnpolicyserviceModule.v1beta.OnlineReturnPolicyServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_programs_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_programs_service_v1beta.ts deleted file mode 100644 index 1eb5089ebeb..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_programs_service_v1beta.ts +++ /dev/null @@ -1,1347 +0,0 @@ -// 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 programsserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta.ProgramsServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient(); - 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 = programsserviceModule.v1beta.ProgramsServiceClient.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 = programsserviceModule.v1beta.ProgramsServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({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 programsserviceModule.v1beta.ProgramsServiceClient(); - 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 programsserviceModule.v1beta.ProgramsServiceClient({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 programsserviceModule.v1beta.ProgramsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = programsserviceModule.v1beta.ProgramsServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.programsServiceStub, undefined); - await client.initialize(); - assert(client.programsServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.programsServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.programsServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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('getProgram', () => { - it('invokes getProgram without error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetProgramRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Program() - ); - client.innerApiCalls.getProgram = stubSimpleCall(expectedResponse); - const [response] = await client.getProgram(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProgram as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProgram as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProgram without error using callback', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetProgramRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Program() - ); - client.innerApiCalls.getProgram = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProgram( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IProgram|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProgram as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProgram as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProgram with error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetProgramRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProgram = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProgram(request), expectedError); - const actualRequest = (client.innerApiCalls.getProgram as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProgram as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProgram with closed client', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetProgramRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getProgram(request), expectedError); - }); - }); - - describe('enableProgram', () => { - it('invokes enableProgram without error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.EnableProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.EnableProgramRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Program() - ); - client.innerApiCalls.enableProgram = stubSimpleCall(expectedResponse); - const [response] = await client.enableProgram(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.enableProgram as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProgram as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableProgram without error using callback', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.EnableProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.EnableProgramRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Program() - ); - client.innerApiCalls.enableProgram = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.enableProgram( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IProgram|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.enableProgram as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProgram as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableProgram with error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.EnableProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.EnableProgramRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.enableProgram = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.enableProgram(request), expectedError); - const actualRequest = (client.innerApiCalls.enableProgram as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProgram as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableProgram with closed client', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.EnableProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.EnableProgramRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.enableProgram(request), expectedError); - }); - }); - - describe('disableProgram', () => { - it('invokes disableProgram without error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DisableProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DisableProgramRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Program() - ); - client.innerApiCalls.disableProgram = stubSimpleCall(expectedResponse); - const [response] = await client.disableProgram(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.disableProgram as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProgram as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableProgram without error using callback', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DisableProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DisableProgramRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Program() - ); - client.innerApiCalls.disableProgram = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.disableProgram( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IProgram|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.disableProgram as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProgram as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableProgram with error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DisableProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DisableProgramRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.disableProgram = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.disableProgram(request), expectedError); - const actualRequest = (client.innerApiCalls.disableProgram as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProgram as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableProgram with closed client', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DisableProgramRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DisableProgramRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.disableProgram(request), expectedError); - }); - }); - - describe('listPrograms', () => { - it('invokes listPrograms without error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - ]; - client.innerApiCalls.listPrograms = stubSimpleCall(expectedResponse); - const [response] = await client.listPrograms(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listPrograms as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPrograms as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listPrograms without error using callback', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - ]; - client.innerApiCalls.listPrograms = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listPrograms( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IProgram[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listPrograms as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPrograms as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listPrograms with error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listPrograms = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listPrograms(request), expectedError); - const actualRequest = (client.innerApiCalls.listPrograms as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPrograms as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProgramsStream without error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - ]; - client.descriptors.page.listPrograms.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listProgramsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.Program[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Program) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listPrograms.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPrograms, request)); - assert( - (client.descriptors.page.listPrograms.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listProgramsStream with error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listPrograms.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listProgramsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.Program[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Program) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listPrograms.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listPrograms, request)); - assert( - (client.descriptors.page.listPrograms.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listPrograms without error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Program()), - ]; - client.descriptors.page.listPrograms.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.shopping.merchant.accounts.v1beta.IProgram[] = []; - const iterable = client.listProgramsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listPrograms.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listPrograms.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listPrograms with error', async () => { - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListProgramsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListProgramsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listPrograms.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listProgramsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.shopping.merchant.accounts.v1beta.IProgram[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listPrograms.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listPrograms.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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 programsserviceModule.v1beta.ProgramsServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_regions_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_regions_service_v1beta.ts deleted file mode 100644 index 38211d15987..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_regions_service_v1beta.ts +++ /dev/null @@ -1,1459 +0,0 @@ -// 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 regionsserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta.RegionsServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient(); - 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 = regionsserviceModule.v1beta.RegionsServiceClient.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 = regionsserviceModule.v1beta.RegionsServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({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 regionsserviceModule.v1beta.RegionsServiceClient(); - 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 regionsserviceModule.v1beta.RegionsServiceClient({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 regionsserviceModule.v1beta.RegionsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = regionsserviceModule.v1beta.RegionsServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.regionsServiceStub, undefined); - await client.initialize(); - assert(client.regionsServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.regionsServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.regionsServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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('getRegion', () => { - it('invokes getRegion without error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetRegionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Region() - ); - client.innerApiCalls.getRegion = stubSimpleCall(expectedResponse); - const [response] = await client.getRegion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRegion without error using callback', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetRegionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Region() - ); - client.innerApiCalls.getRegion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getRegion( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IRegion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRegion with error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetRegionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getRegion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getRegion(request), expectedError); - const actualRequest = (client.innerApiCalls.getRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getRegion with closed client', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetRegionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getRegion(request), expectedError); - }); - }); - - describe('createRegion', () => { - it('invokes createRegion without error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateRegionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Region() - ); - client.innerApiCalls.createRegion = stubSimpleCall(expectedResponse); - const [response] = await client.createRegion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRegion without error using callback', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateRegionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Region() - ); - client.innerApiCalls.createRegion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createRegion( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IRegion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRegion with error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateRegionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createRegion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createRegion(request), expectedError); - const actualRequest = (client.innerApiCalls.createRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createRegion with closed client', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateRegionRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createRegion(request), expectedError); - }); - }); - - describe('updateRegion', () => { - it('invokes updateRegion without error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest() - ); - request.region ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest', ['region', 'name']); - request.region.name = defaultValue1; - const expectedHeaderRequestParams = `region.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Region() - ); - client.innerApiCalls.updateRegion = stubSimpleCall(expectedResponse); - const [response] = await client.updateRegion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateRegion without error using callback', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest() - ); - request.region ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest', ['region', 'name']); - request.region.name = defaultValue1; - const expectedHeaderRequestParams = `region.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.Region() - ); - client.innerApiCalls.updateRegion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateRegion( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IRegion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateRegion with error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest() - ); - request.region ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest', ['region', 'name']); - request.region.name = defaultValue1; - const expectedHeaderRequestParams = `region.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateRegion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateRegion(request), expectedError); - const actualRequest = (client.innerApiCalls.updateRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateRegion with closed client', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest() - ); - request.region ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateRegionRequest', ['region', 'name']); - request.region.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateRegion(request), expectedError); - }); - }); - - describe('deleteRegion', () => { - it('invokes deleteRegion without error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteRegion = stubSimpleCall(expectedResponse); - const [response] = await client.deleteRegion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRegion without error using callback', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteRegion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteRegion( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRegion with error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRegion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteRegion(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteRegion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteRegion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteRegion with closed client', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteRegionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteRegion(request), expectedError); - }); - }); - - describe('listRegions', () => { - it('invokes listRegions without error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - ]; - client.innerApiCalls.listRegions = stubSimpleCall(expectedResponse); - const [response] = await client.listRegions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRegions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRegions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRegions without error using callback', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - ]; - client.innerApiCalls.listRegions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listRegions( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IRegion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listRegions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRegions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRegions with error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listRegions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listRegions(request), expectedError); - const actualRequest = (client.innerApiCalls.listRegions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listRegions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listRegionsStream without error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - ]; - client.descriptors.page.listRegions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listRegionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.Region[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Region) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listRegions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRegions, request)); - assert( - (client.descriptors.page.listRegions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listRegionsStream with error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listRegions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listRegionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.Region[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.Region) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listRegions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRegions, request)); - assert( - (client.descriptors.page.listRegions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRegions without error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.Region()), - ]; - client.descriptors.page.listRegions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.shopping.merchant.accounts.v1beta.IRegion[] = []; - const iterable = client.listRegionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listRegions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRegions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listRegions with error', async () => { - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListRegionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListRegionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listRegions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listRegionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.shopping.merchant.accounts.v1beta.IRegion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listRegions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listRegions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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 regionsserviceModule.v1beta.RegionsServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_shipping_settings_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_shipping_settings_service_v1beta.ts deleted file mode 100644 index d63a605f56d..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_shipping_settings_service_v1beta.ts +++ /dev/null @@ -1,947 +0,0 @@ -// 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 shippingsettingsserviceModule 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.ShippingSettingsServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient(); - 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 = shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient.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 = shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient(); - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.shippingSettingsServiceStub, undefined); - await client.initialize(); - assert(client.shippingSettingsServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.shippingSettingsServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.shippingSettingsServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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('getShippingSettings', () => { - it('invokes getShippingSettings without error', async () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ShippingSettings() - ); - client.innerApiCalls.getShippingSettings = stubSimpleCall(expectedResponse); - const [response] = await client.getShippingSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getShippingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getShippingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getShippingSettings without error using callback', async () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ShippingSettings() - ); - client.innerApiCalls.getShippingSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getShippingSettings( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IShippingSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getShippingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getShippingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getShippingSettings with error', async () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getShippingSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getShippingSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.getShippingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getShippingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getShippingSettings with closed client', async () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetShippingSettingsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getShippingSettings(request), expectedError); - }); - }); - - describe('insertShippingSettings', () => { - it('invokes insertShippingSettings without error', async () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ShippingSettings() - ); - client.innerApiCalls.insertShippingSettings = stubSimpleCall(expectedResponse); - const [response] = await client.insertShippingSettings(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.insertShippingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.insertShippingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes insertShippingSettings without error using callback', async () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ShippingSettings() - ); - client.innerApiCalls.insertShippingSettings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.insertShippingSettings( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IShippingSettings|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.insertShippingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.insertShippingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes insertShippingSettings with error', async () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.insertShippingSettings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.insertShippingSettings(request), expectedError); - const actualRequest = (client.innerApiCalls.insertShippingSettings as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.insertShippingSettings as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes insertShippingSettings with closed client', async () => { - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.InsertShippingSettingsRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.insertShippingSettings(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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 shippingsettingsserviceModule.v1beta.ShippingSettingsServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_agreement_state_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_agreement_state_service_v1beta.ts deleted file mode 100644 index e7a033e5184..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_agreement_state_service_v1beta.ts +++ /dev/null @@ -1,947 +0,0 @@ -// 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 termsofserviceagreementstateserviceModule 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.TermsOfServiceAgreementStateServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient(); - 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 = termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient.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 = termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient(); - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.termsOfServiceAgreementStateServiceStub, undefined); - await client.initialize(); - assert(client.termsOfServiceAgreementStateServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.termsOfServiceAgreementStateServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.termsOfServiceAgreementStateServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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('getTermsOfServiceAgreementState', () => { - it('invokes getTermsOfServiceAgreementState without error', async () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState() - ); - client.innerApiCalls.getTermsOfServiceAgreementState = stubSimpleCall(expectedResponse); - const [response] = await client.getTermsOfServiceAgreementState(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTermsOfServiceAgreementState without error using callback', async () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState() - ); - client.innerApiCalls.getTermsOfServiceAgreementState = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTermsOfServiceAgreementState( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTermsOfServiceAgreementState with error', async () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTermsOfServiceAgreementState = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTermsOfServiceAgreementState(request), expectedError); - const actualRequest = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTermsOfServiceAgreementState with closed client', async () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceAgreementStateRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTermsOfServiceAgreementState(request), expectedError); - }); - }); - - describe('retrieveForApplicationTermsOfServiceAgreementState', () => { - it('invokes retrieveForApplicationTermsOfServiceAgreementState without error', async () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState() - ); - client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState = stubSimpleCall(expectedResponse); - const [response] = await client.retrieveForApplicationTermsOfServiceAgreementState(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes retrieveForApplicationTermsOfServiceAgreementState without error using callback', async () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.TermsOfServiceAgreementState() - ); - client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.retrieveForApplicationTermsOfServiceAgreementState( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.ITermsOfServiceAgreementState|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes retrieveForApplicationTermsOfServiceAgreementState with error', async () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.retrieveForApplicationTermsOfServiceAgreementState(request), expectedError); - const actualRequest = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.retrieveForApplicationTermsOfServiceAgreementState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes retrieveForApplicationTermsOfServiceAgreementState with closed client', async () => { - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.RetrieveForApplicationTermsOfServiceAgreementStateRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.retrieveForApplicationTermsOfServiceAgreementState(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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 termsofserviceagreementstateserviceModule.v1beta.TermsOfServiceAgreementStateServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_service_v1beta.ts deleted file mode 100644 index 048d0787f4d..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_terms_of_service_service_v1beta.ts +++ /dev/null @@ -1,1022 +0,0 @@ -// 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 termsofserviceserviceModule 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.TermsOfServiceServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient(); - 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 = termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient.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 = termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient(); - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.termsOfServiceServiceStub, undefined); - await client.initialize(); - assert(client.termsOfServiceServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.termsOfServiceServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.termsOfServiceServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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('getTermsOfService', () => { - it('invokes getTermsOfService without error', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.TermsOfService() - ); - client.innerApiCalls.getTermsOfService = stubSimpleCall(expectedResponse); - const [response] = await client.getTermsOfService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTermsOfService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTermsOfService without error using callback', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.TermsOfService() - ); - client.innerApiCalls.getTermsOfService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTermsOfService( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.ITermsOfService|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTermsOfService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTermsOfService with error', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTermsOfService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTermsOfService(request), expectedError); - const actualRequest = (client.innerApiCalls.getTermsOfService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTermsOfService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTermsOfService with closed client', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetTermsOfServiceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTermsOfService(request), expectedError); - }); - }); - - describe('retrieveLatestTermsOfService', () => { - it('invokes retrieveLatestTermsOfService without error', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.TermsOfService() - ); - client.innerApiCalls.retrieveLatestTermsOfService = stubSimpleCall(expectedResponse); - const [response] = await client.retrieveLatestTermsOfService(request); - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes retrieveLatestTermsOfService without error using callback', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.TermsOfService() - ); - client.innerApiCalls.retrieveLatestTermsOfService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.retrieveLatestTermsOfService( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.ITermsOfService|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - }); - - it('invokes retrieveLatestTermsOfService with error', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest() - ); - const expectedError = new Error('expected'); - client.innerApiCalls.retrieveLatestTermsOfService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.retrieveLatestTermsOfService(request), expectedError); - }); - - it('invokes retrieveLatestTermsOfService with closed client', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.RetrieveLatestTermsOfServiceRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.retrieveLatestTermsOfService(request), expectedError); - }); - }); - - describe('acceptTermsOfService', () => { - it('invokes acceptTermsOfService without error', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.acceptTermsOfService = stubSimpleCall(expectedResponse); - const [response] = await client.acceptTermsOfService(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.acceptTermsOfService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acceptTermsOfService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acceptTermsOfService without error using callback', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.acceptTermsOfService = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.acceptTermsOfService( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.acceptTermsOfService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acceptTermsOfService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acceptTermsOfService with error', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.acceptTermsOfService = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.acceptTermsOfService(request), expectedError); - const actualRequest = (client.innerApiCalls.acceptTermsOfService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.acceptTermsOfService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acceptTermsOfService with closed client', async () => { - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.AcceptTermsOfServiceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.acceptTermsOfService(request), expectedError); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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 termsofserviceserviceModule.v1beta.TermsOfServiceServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_user_service_v1beta.ts b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_user_service_v1beta.ts deleted file mode 100644 index f85b8226471..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/test/gapic_user_service_v1beta.ts +++ /dev/null @@ -1,1459 +0,0 @@ -// 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 userserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta.UserServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new userserviceModule.v1beta.UserServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new userserviceModule.v1beta.UserServiceClient(); - 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 = userserviceModule.v1beta.UserServiceClient.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 = userserviceModule.v1beta.UserServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'merchantapi.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new userserviceModule.v1beta.UserServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'merchantapi.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new userserviceModule.v1beta.UserServiceClient({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 userserviceModule.v1beta.UserServiceClient(); - 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 userserviceModule.v1beta.UserServiceClient({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 userserviceModule.v1beta.UserServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = userserviceModule.v1beta.UserServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new userserviceModule.v1beta.UserServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.userServiceStub, undefined); - await client.initialize(); - assert(client.userServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.userServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.userServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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('getUser', () => { - it('invokes getUser without error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.User() - ); - client.innerApiCalls.getUser = stubSimpleCall(expectedResponse); - const [response] = await client.getUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser without error using callback', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.User() - ); - client.innerApiCalls.getUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getUser( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser with error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getUser(request), expectedError); - const actualRequest = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getUser with closed client', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.GetUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.GetUserRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getUser(request), expectedError); - }); - }); - - describe('createUser', () => { - it('invokes createUser without error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.User() - ); - client.innerApiCalls.createUser = stubSimpleCall(expectedResponse); - const [response] = await client.createUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser without error using callback', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.User() - ); - client.innerApiCalls.createUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createUser( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser with error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createUser(request), expectedError); - const actualRequest = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createUser with closed client', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.CreateUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.CreateUserRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createUser(request), expectedError); - }); - }); - - describe('deleteUser', () => { - it('invokes deleteUser without error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteUser = stubSimpleCall(expectedResponse); - const [response] = await client.deleteUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser without error using callback', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteUser( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser with error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteUser(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteUser with closed client', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.DeleteUserRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.DeleteUserRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteUser(request), expectedError); - }); - }); - - describe('updateUser', () => { - it('invokes updateUser without error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.User() - ); - client.innerApiCalls.updateUser = stubSimpleCall(expectedResponse); - const [response] = await client.updateUser(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser without error using callback', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.User() - ); - client.innerApiCalls.updateUser = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateUser( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IUser|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser with error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateUser = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateUser(request), expectedError); - const actualRequest = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateUser as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateUser with closed client', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.UpdateUserRequest() - ); - request.user ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.UpdateUserRequest', ['user', 'name']); - request.user.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateUser(request), expectedError); - }); - }); - - describe('listUsers', () => { - it('invokes listUsers without error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - ]; - client.innerApiCalls.listUsers = stubSimpleCall(expectedResponse); - const [response] = await client.listUsers(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsers without error using callback', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - ]; - client.innerApiCalls.listUsers = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listUsers( - request, - (err?: Error|null, result?: protos.google.shopping.merchant.accounts.v1beta.IUser[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsers with error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listUsers(request), expectedError); - const actualRequest = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listUsers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listUsersStream without error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - ]; - client.descriptors.page.listUsers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listUsersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.User[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.User) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); - assert( - (client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listUsersStream with error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsers.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listUsersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.shopping.merchant.accounts.v1beta.User[] = []; - stream.on('data', (response: protos.google.shopping.merchant.accounts.v1beta.User) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listUsers, request)); - assert( - (client.descriptors.page.listUsers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsers without error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - generateSampleMessage(new protos.google.shopping.merchant.accounts.v1beta.User()), - ]; - client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.shopping.merchant.accounts.v1beta.IUser[] = []; - const iterable = client.listUsersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listUsers with error', async () => { - const client = new userserviceModule.v1beta.UserServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.shopping.merchant.accounts.v1beta.ListUsersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.shopping.merchant.accounts.v1beta.ListUsersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listUsersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.shopping.merchant.accounts.v1beta.IUser[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listUsers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('account', () => { - const fakePath = "/rendered/path/account"; - const expectedParameters = { - account: "accountValue", - }; - const client = new userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 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 = { - account: "accountValue", - }; - const client = new userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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 userserviceModule.v1beta.UserServiceClient({ - 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/tsconfig.json b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/webpack.config.js b/owl-bot-staging/google-shopping-merchant-accounts/v1beta/webpack.config.js deleted file mode 100644 index f335a762c1c..00000000000 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'AccountIssueService', - filename: './account-issue-service.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto similarity index 100% rename from owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto rename to packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/accountservices.proto diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto b/packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto similarity index 100% rename from owl-bot-staging/google-shopping-merchant-accounts/v1beta/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto rename to packages/google-shopping-merchant-accounts/protos/google/shopping/merchant/accounts/v1beta/autofeedsettings.proto 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/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 similarity index 100% rename from owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js rename to packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.get_autofeed_settings.js diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/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 similarity index 100% rename from owl-bot-staging/google-shopping-merchant-accounts/v1beta/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js rename to packages/google-shopping-merchant-accounts/samples/generated/v1beta/autofeed_settings_service.update_autofeed_settings.js 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/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client.ts b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client.ts similarity index 70% rename from owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client.ts rename to packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client.ts index 2ed5f37bb51..10db249d7fa 100644 --- a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client.ts +++ b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client.ts @@ -18,7 +18,12 @@ /* global window */ import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -98,20 +103,42 @@ export class AutofeedSettingsServiceClient { * const client = new AutofeedSettingsServiceClient({fallback: true}, gax); * ``` */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + 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 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'; + 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 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'); + 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. @@ -137,7 +164,7 @@ export class AutofeedSettingsServiceClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -151,10 +178,7 @@ export class AutofeedSettingsServiceClient { } // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process === 'object' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -214,9 +238,10 @@ export class AutofeedSettingsServiceClient { termsOfServicePathTemplate: new this._gaxModule.PathTemplate( 'termsOfService/{version}' ), - termsOfServiceAgreementStatePathTemplate: new this._gaxModule.PathTemplate( - 'accounts/{account}/termsOfServiceAgreementStates/{identifier}' - ), + termsOfServiceAgreementStatePathTemplate: + new this._gaxModule.PathTemplate( + 'accounts/{account}/termsOfServiceAgreementStates/{identifier}' + ), userPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/users/{email}' ), @@ -224,8 +249,11 @@ export class AutofeedSettingsServiceClient { // 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(' ')}); + '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 @@ -256,31 +284,39 @@ export class AutofeedSettingsServiceClient { // 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}>; + 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']; + 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) => () => { + 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 descriptor = undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -300,8 +336,14 @@ export class AutofeedSettingsServiceClient { * @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'); + 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'; } @@ -312,8 +354,14 @@ export class AutofeedSettingsServiceClient { * @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'); + 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'; } @@ -344,9 +392,7 @@ export class AutofeedSettingsServiceClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/content' - ]; + return ['https://www.googleapis.com/auth/content']; } getProjectId(): Promise; @@ -355,8 +401,9 @@ export class AutofeedSettingsServiceClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -367,148 +414,204 @@ export class AutofeedSettingsServiceClient { // ------------------- // -- 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 - */ + /** + * 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 - ]>; + 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; + 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; + 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< + 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 { + | 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 { + } 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 ?? '', - }); + 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 - */ + /** + * 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 - ]>; + 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; + 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; + 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< + 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 { + | 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 { + } 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 ?? '', - }); + 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); + return this.innerApiCalls.updateAutofeedSettings( + request, + options, + callback + ); } // -------------------- @@ -521,7 +624,7 @@ export class AutofeedSettingsServiceClient { * @param {string} account * @returns {string} Resource name string. */ - accountPath(account:string) { + accountPath(account: string) { return this.pathTemplates.accountPathTemplate.render({ account: account, }); @@ -545,7 +648,7 @@ export class AutofeedSettingsServiceClient { * @param {string} issue * @returns {string} Resource name string. */ - accountIssuePath(account:string,issue:string) { + accountIssuePath(account: string, issue: string) { return this.pathTemplates.accountIssuePathTemplate.render({ account: account, issue: issue, @@ -560,7 +663,8 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the account. */ matchAccountFromAccountIssueName(accountIssueName: string) { - return this.pathTemplates.accountIssuePathTemplate.match(accountIssueName).account; + return this.pathTemplates.accountIssuePathTemplate.match(accountIssueName) + .account; } /** @@ -571,7 +675,8 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the issue. */ matchIssueFromAccountIssueName(accountIssueName: string) { - return this.pathTemplates.accountIssuePathTemplate.match(accountIssueName).issue; + return this.pathTemplates.accountIssuePathTemplate.match(accountIssueName) + .issue; } /** @@ -581,7 +686,7 @@ export class AutofeedSettingsServiceClient { * @param {string} tax * @returns {string} Resource name string. */ - accountTaxPath(account:string,tax:string) { + accountTaxPath(account: string, tax: string) { return this.pathTemplates.accountTaxPathTemplate.render({ account: account, tax: tax, @@ -596,7 +701,8 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the account. */ matchAccountFromAccountTaxName(accountTaxName: string) { - return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName).account; + return this.pathTemplates.accountTaxPathTemplate.match(accountTaxName) + .account; } /** @@ -616,7 +722,7 @@ export class AutofeedSettingsServiceClient { * @param {string} account * @returns {string} Resource name string. */ - autofeedSettingsPath(account:string) { + autofeedSettingsPath(account: string) { return this.pathTemplates.autofeedSettingsPathTemplate.render({ account: account, }); @@ -630,7 +736,9 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the account. */ matchAccountFromAutofeedSettingsName(autofeedSettingsName: string) { - return this.pathTemplates.autofeedSettingsPathTemplate.match(autofeedSettingsName).account; + return this.pathTemplates.autofeedSettingsPathTemplate.match( + autofeedSettingsName + ).account; } /** @@ -639,7 +747,7 @@ export class AutofeedSettingsServiceClient { * @param {string} account * @returns {string} Resource name string. */ - businessIdentityPath(account:string) { + businessIdentityPath(account: string) { return this.pathTemplates.businessIdentityPathTemplate.render({ account: account, }); @@ -653,7 +761,9 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the account. */ matchAccountFromBusinessIdentityName(businessIdentityName: string) { - return this.pathTemplates.businessIdentityPathTemplate.match(businessIdentityName).account; + return this.pathTemplates.businessIdentityPathTemplate.match( + businessIdentityName + ).account; } /** @@ -662,7 +772,7 @@ export class AutofeedSettingsServiceClient { * @param {string} account * @returns {string} Resource name string. */ - businessInfoPath(account:string) { + businessInfoPath(account: string) { return this.pathTemplates.businessInfoPathTemplate.render({ account: account, }); @@ -676,7 +786,8 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the account. */ matchAccountFromBusinessInfoName(businessInfoName: string) { - return this.pathTemplates.businessInfoPathTemplate.match(businessInfoName).account; + return this.pathTemplates.businessInfoPathTemplate.match(businessInfoName) + .account; } /** @@ -686,7 +797,7 @@ export class AutofeedSettingsServiceClient { * @param {string} email * @returns {string} Resource name string. */ - emailPreferencesPath(account:string,email:string) { + emailPreferencesPath(account: string, email: string) { return this.pathTemplates.emailPreferencesPathTemplate.render({ account: account, email: email, @@ -701,7 +812,9 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the account. */ matchAccountFromEmailPreferencesName(emailPreferencesName: string) { - return this.pathTemplates.emailPreferencesPathTemplate.match(emailPreferencesName).account; + return this.pathTemplates.emailPreferencesPathTemplate.match( + emailPreferencesName + ).account; } /** @@ -712,7 +825,9 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the email. */ matchEmailFromEmailPreferencesName(emailPreferencesName: string) { - return this.pathTemplates.emailPreferencesPathTemplate.match(emailPreferencesName).email; + return this.pathTemplates.emailPreferencesPathTemplate.match( + emailPreferencesName + ).email; } /** @@ -721,7 +836,7 @@ export class AutofeedSettingsServiceClient { * @param {string} account * @returns {string} Resource name string. */ - homepagePath(account:string) { + homepagePath(account: string) { return this.pathTemplates.homepagePathTemplate.render({ account: account, }); @@ -745,7 +860,7 @@ export class AutofeedSettingsServiceClient { * @param {string} return_policy * @returns {string} Resource name string. */ - onlineReturnPolicyPath(account:string,returnPolicy:string) { + onlineReturnPolicyPath(account: string, returnPolicy: string) { return this.pathTemplates.onlineReturnPolicyPathTemplate.render({ account: account, return_policy: returnPolicy, @@ -760,7 +875,9 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the account. */ matchAccountFromOnlineReturnPolicyName(onlineReturnPolicyName: string) { - return this.pathTemplates.onlineReturnPolicyPathTemplate.match(onlineReturnPolicyName).account; + return this.pathTemplates.onlineReturnPolicyPathTemplate.match( + onlineReturnPolicyName + ).account; } /** @@ -771,7 +888,9 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the return_policy. */ matchReturnPolicyFromOnlineReturnPolicyName(onlineReturnPolicyName: string) { - return this.pathTemplates.onlineReturnPolicyPathTemplate.match(onlineReturnPolicyName).return_policy; + return this.pathTemplates.onlineReturnPolicyPathTemplate.match( + onlineReturnPolicyName + ).return_policy; } /** @@ -781,7 +900,7 @@ export class AutofeedSettingsServiceClient { * @param {string} program * @returns {string} Resource name string. */ - programPath(account:string,program:string) { + programPath(account: string, program: string) { return this.pathTemplates.programPathTemplate.render({ account: account, program: program, @@ -817,7 +936,7 @@ export class AutofeedSettingsServiceClient { * @param {string} region * @returns {string} Resource name string. */ - regionPath(account:string,region:string) { + regionPath(account: string, region: string) { return this.pathTemplates.regionPathTemplate.render({ account: account, region: region, @@ -852,7 +971,7 @@ export class AutofeedSettingsServiceClient { * @param {string} account * @returns {string} Resource name string. */ - shippingSettingsPath(account:string) { + shippingSettingsPath(account: string) { return this.pathTemplates.shippingSettingsPathTemplate.render({ account: account, }); @@ -866,7 +985,9 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the account. */ matchAccountFromShippingSettingsName(shippingSettingsName: string) { - return this.pathTemplates.shippingSettingsPathTemplate.match(shippingSettingsName).account; + return this.pathTemplates.shippingSettingsPathTemplate.match( + shippingSettingsName + ).account; } /** @@ -875,7 +996,7 @@ export class AutofeedSettingsServiceClient { * @param {string} version * @returns {string} Resource name string. */ - termsOfServicePath(version:string) { + termsOfServicePath(version: string) { return this.pathTemplates.termsOfServicePathTemplate.render({ version: version, }); @@ -889,7 +1010,9 @@ export class AutofeedSettingsServiceClient { * @returns {string} A string representing the version. */ matchVersionFromTermsOfServiceName(termsOfServiceName: string) { - return this.pathTemplates.termsOfServicePathTemplate.match(termsOfServiceName).version; + return this.pathTemplates.termsOfServicePathTemplate.match( + termsOfServiceName + ).version; } /** @@ -899,7 +1022,7 @@ export class AutofeedSettingsServiceClient { * @param {string} identifier * @returns {string} Resource name string. */ - termsOfServiceAgreementStatePath(account:string,identifier:string) { + termsOfServiceAgreementStatePath(account: string, identifier: string) { return this.pathTemplates.termsOfServiceAgreementStatePathTemplate.render({ account: account, identifier: identifier, @@ -913,8 +1036,12 @@ export class AutofeedSettingsServiceClient { * A fully-qualified path representing TermsOfServiceAgreementState resource. * @returns {string} A string representing the account. */ - matchAccountFromTermsOfServiceAgreementStateName(termsOfServiceAgreementStateName: string) { - return this.pathTemplates.termsOfServiceAgreementStatePathTemplate.match(termsOfServiceAgreementStateName).account; + matchAccountFromTermsOfServiceAgreementStateName( + termsOfServiceAgreementStateName: string + ) { + return this.pathTemplates.termsOfServiceAgreementStatePathTemplate.match( + termsOfServiceAgreementStateName + ).account; } /** @@ -924,8 +1051,12 @@ export class AutofeedSettingsServiceClient { * A fully-qualified path representing TermsOfServiceAgreementState resource. * @returns {string} A string representing the identifier. */ - matchIdentifierFromTermsOfServiceAgreementStateName(termsOfServiceAgreementStateName: string) { - return this.pathTemplates.termsOfServiceAgreementStatePathTemplate.match(termsOfServiceAgreementStateName).identifier; + matchIdentifierFromTermsOfServiceAgreementStateName( + termsOfServiceAgreementStateName: string + ) { + return this.pathTemplates.termsOfServiceAgreementStatePathTemplate.match( + termsOfServiceAgreementStateName + ).identifier; } /** @@ -935,7 +1066,7 @@ export class AutofeedSettingsServiceClient { * @param {string} email * @returns {string} Resource name string. */ - userPath(account:string,email:string) { + userPath(account: string, email: string) { return this.pathTemplates.userPathTemplate.render({ account: account, email: email, diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client_config.json b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client_config.json similarity index 100% rename from owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_client_config.json rename to packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_client_config.json diff --git a/owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_proto_list.json b/packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_proto_list.json similarity index 100% rename from owl-bot-staging/google-shopping-merchant-accounts/v1beta/src/v1beta/autofeed_settings_service_proto_list.json rename to packages/google-shopping-merchant-accounts/src/v1beta/autofeed_settings_service_proto_list.json 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 = {